Then-Gov. Martin O’Malley holds up a phone number for people to call to get help enrolling for insurance in the state’s health-care exchange in March 2014. (Brian Witte/AP)

The prime contractor hired to build Maryland’s flawed online health exchange will pay $45 million to the state and federal governments to avoid a lawsuit over its performance, Attorney General Brian Frosh announced Tuesday.

Maryland’s health exchange drew national attention last year when the Web site crashed moments after launching. It was plagued by glitches for months afterward.

Noridian Healthcare Solutions agreed to pay $20 million upfront and an additional $25 million in annual installments of $5 million over five years, Frosh’s office said. The payments represent 61 percent of the total paid to the company, based in Fargo, N.D., for the development and launch of the Web site.

“This settlement sends a message that the performance was unacceptable, and that those responsible will be held accountable,” Frosh (D) said in a statement Tuesday. Frosh’s office said the agreement, which is subject to regulatory approvals, will lead to the recovery of funds for Maryland and the federal Centers for Medicare and Medicaid Services, which provided significant funding for the exchange.

The attorney general said the settlement represents a “fair deal” for taxpayers, even though Noridian will not pay back the full amount it received.

“Given the constraints on the company’s finances, it is doubtful that Maryland could have collected this amount from Noridian Healthcare even if it obtained an equal or higher judgment after years of litigation,” Frosh said.

Gov. Larry Hogan (R), a vocal critic of his predecessor’s handling of the exchange, said in a statement that he was “pleased that the process for recouping taxpayer losses has begun.”

Frosh said the state is still investigating claims against other companies involved in the debacle, and Hogan promised that the state would “continue to aggressively pursue other avenues to recover damages.”

Noridian said the settlement “allows us to move forward and focus on our core business of processing health care claims and providing related administrative services.” Noridian also defended its performance. The company said that many states experienced challenges creating exchanges and that it implemented technical enhancements that ultimately helped Maryland meet its enrollment goals.

Maryland was one of 14 states that decided to establish their own health-insurance marketplaces to comply with the Affordable Care Act, which was championed by President Obama and mandated that all Americans obtain health insurance or pay a penalty.

Then-Gov. Martin O’Malley (D), now a presidential candidate, predicted the Maryland marketplace and its accompanying Web site would be among the best in the nation. But Noridian’s online portal failed within minutes of launching on Oct. 1, 2013.

“This company never delivered on what it promised, and, as a result, tens of millions of taxpayer dollars were wasted, and thousands of Marylanders suffered delays and frustration,” Frosh said.

The Maryland Health Benefit Exchange fired Noridian last year, terminating a $193 million contract, and hired another firm to rebuild the site with technology that worked well in Connecticut.

The failure was a deep embarrassment for O’Malley. It also damaged the credibility of then-Lt. Gov. Anthony Brown (D), who was tasked with overseeing the state’s compliance with the Affordable Care Act. Hogan repeatedly blamed Brown for problems with the health exchange when the two ran for governor in 2014.

A Washington Post investigation showed that Maryland officials failed to heed warning signs that the system had design and functionality problems.

While Maryland’s enrollment rates initially were among the worst in the nation, the numbers improved dramatically once the online exchange was fixed. More than 289,000 Marylanders were covered through the state-based marketplace as of Feb. 28, according to the latest figures from the state. Maryland’s goal was to enroll 260,000 individuals.