BALTIMORE — Maryland will recover $81 million from a contractor that the state says failed to rebuild the state’s Medicaid computer system.

Attorney General Brian Frosh announced the settlement Friday with Computer Sciences Corporation, which was a state contractor to the state health department. He says it compensates the state for the damages suffered from the failure of the company to live up to its obligations.

The state ended its $170 million contract with Computer Sciences Corp. in 2015 after complaining for a year about the company’s work. The state had already paid about $27 million to the company, with much of the money coming from federal funds.

The attorney general’s office says the settlement resolves claims by both parties.