AUGUSTA, Maine — The Maine Senate took a final vote Thursday night to pass an expansion of Medicaid under the federal Affordable Care Act, but Democrats again fell short of attracting enough Republican votes to override a likely veto from Gov. Paul LePage.

The bill now heads to LePage’s desk.

The measure passed the Senate 23-12, falling one vote short of a veto-proof margin. The House took a final, 97-51 vote on the bill on Wednesday.

The Thursday night vote, along with votes on the two-year state budget and a bill proposed by LePage that pays off Maine’s $484 million hospital debt, mean LePage is likely to receive those three major bills for his consideration at the same time following successive votes on the measures Wednesday and Thursday.

The Medicaid bill Thursday night attracted the support of the same three Republicans who supported the measure last week: Sens. Patrick Flood of Winthrop, Roger Katz of Augusta and Tom Saviello of Wilton.

The bill heading to LePage is a compromise measure designed to attract more Republican support that would allow the state to expand Medicaid under the federal Affordable Care Act but cut off the expansion after three years.

The measure would sign Maine up for the expansion under the federal health care law but have Maine withdraw after the three years during which the federal government pays 100 percent of expansion costs unless the Legislature at that time decides otherwise.

“It gives us the time to make a decision on whether we want to move forward,” said Senate Majority Leader Seth Goodall, D-Richmond. “It is compromise. Is it in the best interests of the state? Yes.”

The deal would also require the Legislature hire a nonpartisan research group to study the effect of Maine’s Medicaid expansion after the three-year period expires. And Katz proposed allowing the state’s Medicaid program, known as MaineCare, to charge patients the maximum co-payments allowed under federal law as a way to dissuade Medicaid recipients from using the emergency room for care.

Because Maine would spend less in-state funds on Medicaid during the first three years of the expansion, and the state Department of Health and Human Services is working on a number of initiatives to reduce Medicaid costs, Katz’s proposal would set aside the savings in a special account that could be used to cover additional Medicaid costs once the federal government’s share of expansion costs drops below 100 percent in 2017.

Democrats continued to argue for the benefits of expansion while Republican opponents urged caution.

“As a legislator, I would be foolish to expect to see the 90 percent match forever,” said Sen. Garrett Mason, R-Lisbon Falls, referring to the 90 percent federal funding rate the Affordable Care Act promises for the expanded Medicaid program after 2020.

Mason also doubted lawmakers would have the heart to end the expanded Medicaid program after the first three years. “I don’t believe this Legislature or any future one will have the stomach to say ‘No’ to 70,000 people.”

Sen. Geoffrey Gratwick, D-Bangor, asked what it would take to change his Republican colleagues’ minds so they would support expanding Medicaid.

“Tonight, I ask people to open their minds, to enlarge their minds, to vote differently,” he said. “If you vote differently on this, there’s no question that some here will excoriate you. Nevertheless, you’ll have to know that they respect you.”