AUGUSTA, Maine — The Maine Senate voted 23-12 Thursday to allow the state to expand its Medicaid program under the federal Affordable Care Act.

Senators voted on a compromise measure offered by the Senate’s assistant Republican leader, Roger Katz of Augusta, that managed to attract more Republican support than the original version of the Medicaid expansion bill, which passed earlier this week in the House.

The amended bill next heads to the House, where the changes stand a chance of appealing to more Republicans, before returning to the Senate. Advocates for Medicaid expansion, mostly Democrats, have worked aggressively to amass enough support to overcome a likely veto by Republican Gov. Paul LePage.

Katz introduced an amendment that would allow Maine to participate in the Medicaid expansion for three years and drop out after that. That’s the period during which the federal government would pay 100 percent of the costs for expanding insurance coverage to about 50,000 low-income adults without children whose income falls below the federal poverty level. The Legislature at that time, alternatively, could opt to continue Maine’s participation in the expansion.

The measure also would allow about 25,000 parents and adults without children to keep their coverage on Jan. 1, 2014, when the expansion takes effect. Under current law, they would lose their coverage at the start of 2014.

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

“It won’t raise a lot of money,” Katz said, “but it sends an appropriate, important lesson about the consequences of using the system.”

Under the proposal, the state Department of Health and Human Services would set new copayment rates for some of the Medicaid recipients who gain coverage under the expansion. Currently, Medicaid recipients pay copayments including $3 for an ambulance, $2 for a psychologist’s services and $3 per day for inpatient hospital treatments.

Katz’s amendment was designed to address a number of concerns Republicans have raised about expanding Medicaid, including concerns about the cost to the state of continuing its coverage levels after federal funding rates have dropped below their initial 100 percent level and worries that the federal government could back off its promise to cover 100 percent of expansion costs for the first three years. The 100 percent rate would gradually drop to 90 percent by 2020; the federal government currently covers 62.57 percent of Maine’s Medicaid costs.

Katz’s amendment would withdraw Maine from the expansion if the federal government’s funding levels dropped below what has been promised under the Affordable Care Act.

One Senate Republican, Sen. Thomas Saviello of Wilton, has supported Medicaid expansion since the original legislation was proposed. Katz’s amendment attracted the support of two additional Republicans: Katz and Sen. Patrick Flood of Winthrop. Still, the 23-12 tally fell one vote short of the two-thirds threshold that would be needed to override a veto from Gov. Paul LePage, who has opposed expanding Medicaid.

Two Senate Republicans, Brian Langley of Ellsworth and Rodney Whittemore of Skowhegan, cosponsored the expansion bill but voted against it.

The measure next returns to the House, where it needs the support of eight Republicans to overcome a LePage veto. Five Republicans voted with their Democratic colleagues Monday, when the bill passed the House 89-51.

During debate on the Senate floor, Katz touted the economic benefits of expanding Medicaid. A 2012 analysis by the Kaiser Family Foundation projected Maine would see $3.1 billion in additional federal funds by expanding Medicaid.

“Medicaid expansion dollars don’t go to recipients,” Katz said. “They go to services and create thousands of jobs for our neighbors. I think it’s important that we don’t lose sight of that.”

Katz, who is serving his second Senate term, called his decision on Medicaid expansion “the most difficult decision I have had to make in my time here in the Senate.

“I cast my vote not with any moral certainty that what I’m doing is right, but with the belief that what I have done is the best I can for my state.”

Democrats praised Katz for arriving at a compromise on an issue that has deeply divided Democrats and Republicans in the State House this spring.

“Is it everything that Democrats want? No. Is it everything that Republicans want? No,” said Sen. Seth Goodall, D-Richmond, the Senate majority leader. “We must come together on the challenging issues. This is one of the most challenging issues this year. Lives are on the line.”

But most Senate Republicans repeated their opposition to expanding Medicaid.

“I think this makes a terrible bill worse,” said Sen. Doug Thomas, R-Ripley. “You can’t let people become dependent on this and then take it away.”

Others warned that the state can’t afford a larger Medicaid program when its current program is subject to frequent cost overruns and hundreds of people with developmental disabilities are on a wait list for certain home- and community-based services.

“We still have these people on waiting lists,” said Sen. Garrett Mason, R-Lisbon Falls. “They’ve been on there for years. We’re still putting able-bodied adults in front of these people. I think that that borders on insane.”