As Maryland’s top health official testified before a congressional committee and addressed a panel of state lawmakers on Thursday, he kept facing questions about how much the state spent on its troubled health insurance marketplace — and how much more it will have to spend to replace that system.

Joshua M. Sharfstein, Maryland’s secretary of health and mental hygiene, did not always have firm answers to those questions.

Maryland has spent about $129 million on its exchange, a key part of implementing the Affordable Care Act that allows residents to sign up for health-care coverage, often with the help of a government subsidy. Nearly all of that investment was financed by the federal government, which has given Maryland about $180 million in grants. Over four years, Maryland plans to spend at least $260 million on the exchange.

Earlier this week, the exchange’s board voted to hire Deloitte Consulting to overhaul the system and replace it with technology borrowed from Connecticut. Maryland hopes that it can salvage some of the current system’s hardware and software. But of the $55 million the state spent on that, along with development costs, the state only plans to keep $8 million worth.

The change is expected to cost $40 million to $50 million, plus the cost of additional hardware and software. State officials have been unable to provide a more precise amount.

Sharfstein, who is chairman of the exchange board, told local lawmakers on Thursday that he expects federal funds to cover most of the cost. As of Thursday, however, federal authorities had yet to approve Maryland’s plan for the future of the exchange.

The exchange has already found $11.4 million in its budget that can go toward the revamp, Sharfstein said. Some of that money previously would have gone to Noridian Healthcare Solutions, a North Dakota-based company that was hired to build the exchange and fired in late February. It’s unclear if officials will seek additional money from the state or the federal government for the exchange.

Maryland will also “seek to recover as much as possible of the remainder from our original contractors and will share the recovery with the federal government,” Sharfstein stated in written testimony provided to members of the U.S. House Committee on Oversight and Government Reform.

Sharfstein told state lawmakers during a Thursday evening oversight meeting that Maryland and Noridian have agreed to a “six-month standstill” before taking legal action.

Tom McGraw, president and chief executive of Noridian, said this week that the company “complied with its contractual obligations under tremendous regulatory and financial pressures.” McGraw said the project became more complex as the federal government released new regulations.

Maryland’s original request for proposals, in October 2011, identified 261 requirements, McGraw said in a statement. After Noridian was awarded a “fixed-price prime contract,” the state “added 227 new requirements, changed 28 requirements, and dropped 73 original requirements” without providing additional compensation.

“Maryland is now pursuing a simpler, streamlined system that does not contain the additional ‘bells and whistles’ that the state demanded of Noridian after contract award, and that led to many of the system problems that were experienced on Oct. 1,” McGraw said.

IBM, which made the off-the-shelf health-care software used to build Maryland’s exchange, also maintains that it did all that it could to help.

“IBM has worked closely with the state to improve the user experience and has repeatedly and consistently gone above and beyond our contractual responsibilities in an effort to overcome the state’s failure to properly manage the implementation of the exchange,” said Clint Roswell, an IBM spokesman, in a statement this week.

Sharfstein told lawmakers that Maryland made a few decisions that contributed to its problems, such as using off-the-shelf software that gave the state limited control to make changes, and attempting to fully upgrade Medicaid eligibility and enrollment software at the same time it built an exchange.

“Maryland’s story includes decisions we wish we could make again, failures by multiple vendors, and too many IT frustrations to count,” Sharfstein told the congressional committee members.

Despite the exchange’s widespread problems, Sharfstein said, the state was able to enroll more than 232,000 people in Medicaid and 63,000 in private plans. More than 18,000 others have expressed interest in signing up for private plans and will be allowed to do so in the coming weeks, even though the first open enrollment period formally ended on Monday.

Mary Pat Flaherty and Fredrick Kunkle contributed to this report.