Correction: An earlier version of this article stated that no Republicans in the Maryland House of Delegates voted for the legislation. One Republican voted for it. This version has been corrected.

A resident tries to resume an application he started on the Maryland Health Connection insurance exchange Web site at a health insurance education and enrollment event in Silver Spring, Maryland, on Dec. 7, 2013. (Andrew Harrer/Bloomberg)

The Maryland Senate gave final approval Wednesday to a plan for the state to offer temporary, retroactive health insurance to residents unable to sign up through the state’s troubled online marketplace. Maryland Gov. Martin O’Malley (D) sponsored the legislation and is scheduled to sign it into law Thursday morning.

The legislation will expand enrollment in a decade-old, state-run plan that was created to help people who had problems finding coverage because of preexisting conditions. This insurance will be offered as a last-resort option to Marylanders who tried to get coverage through the Maryland Health Benefit Exchange, encountered problems and were left uncovered when 2014 began.

“This bill represents an attempt to correct a wrong, to help people who through no fault of their own anticipated that they would have health-care coverage January 1, have health conditions, have big bills and need some help,” said Del. Peter A. Hammen (D-Baltimore), chairman of the House’s Health and Government Operations Committee, which handled the emergency legislation.

State officials expect only a few hundred people to sign up, because the four insurance carriers involved with the state exchange have also offered retroactive coverage. Applicants must provide evidence of attempts to use the exchange and will have to pay a premium, which is typically more expensive than those offered through the exchange. Enrollment would stay open until March 31. At first, residents will be able to choose insurance that is retroactive to Jan. 1. In coming months, the insurance will be retroactive to Feb. 1 or March 1.

In both chambers, the votes were largely along party lines, with mostly Republicans in opposition. Discussion of the legislation was yet another opportunity for lawmakers — especially those running for statewide office — to question the failures of the Maryland health exchange. The exchange Web site crashed on its launch day, Oct. 1, and has been plagued with problems, keeping thousands of Marylanders from signing up for coverage.

The legislation was amended to require state health officials to provide regular progress reports on enrollment numbers in the state-run program.

Maryland Lt. Gov. Anthony G. Brown (D), who is running for governor, is in charge of implementing President Obama’s Affordable Care Act in Maryland. The House Republican Caucus referred to the legislation as the “Anthony Brown Health Care Exchange bailout” in a tweet.

Critics of the legislation, which passed the Senate on Wednesday by a vote of 34 to 7, said that state officials cannot say exactly how many people will enroll or how much the short-term fix will cost; that it’s unclear how Marylanders will prove that they tried the health exchange Web site; and that there has not been a full review of the exchange’s problems.

State officials originally estimated that anywhere from a few hundred to 5,000 residents would enroll in the retroactive insurance program, costing the state up to $10 million. But earlier this month, the four private carriers involved with the exchange agreed to offer insurance retroactive to Jan. 1 as long as people expressed interest by Jan. 21.

In the week that coverage was available through the private companies, exchange staff workers sent 2,209 e-mails and made 3,045 calls to individuals they knew still lacked insurance, according to officials with the exchanges. They said 1,407 residents then registered, although it is unknown how many will enroll and pay their premiums.

The week-long window for that option was too short and not well publicized, said Del. Heather R. Mizeur (D-Montgomery), who is also running for governor. For a pregnant woman, that could mean paying a high premium and being on two plans within one trimester. On the House floor Friday, Mizeur said that more needs to be done to immediately get Marylanders into permanent plans. She voted for the legislation, as did most Democrats.

Del. Ronald A. George (R-Anne Arundel), also a gubernatorial candidate, also spoke out Friday, saying that lawmakers cannot trust state health officials until they know what went wrong with the exchange and who “ultimately is responsible.”

“How are we going to be confident that these mistakes are not continuing to be made?” George said. He was not present for his chamber’s Tuesday vote, 94 to 42.

Only one Republican in the House voted for the legislation. Del. Jeannie Haddaway-Riccio (R-Talbot), who is running for lieutenant governor, said that the state should not spend “millions more of taxpayer dollars” on a Web site that may never properly work. “This legislation is nothing more than a bailout and a coverup and another waste of taxpayer dollars,” she said.

But Hammen defended the measure: “There are some people that are in need. They need your help. This bill represents that help.”