Last Updated Dec 3, 2015 8:46 PM EST
The Senate on Thursday narrowly passed a bill that would repeal large parts of Obamacare, which now heads back to the House for one more vote.
After voting for hours on amendments to the legislation, the upper chamber passed the bill 52-47.
Senate Majority Leader Mitch McConnell, R-Kentucky, could only afford to lose three Republican votes. Since the bill was crafted under the budget reconciliation process, it needed a simple majority of 51 votes to pass and was not subject to the filibuster.
All four GOP presidential candidates in the Senate -- Ted Cruz, Lindsey Graham, Marco Rubio and Rand Paul -- voted in favor of the bill.
The House passed a similar version of the bill in October along party lines, but it will have to vote on the Senate bill, which will likely happen in the next week. Mr. Obama is expected to veto it.
The legislation would eliminate Obamacare's individual and employer mandates, the medical device tax and the so-called Cadillac tax. It would also cut off funding to Planned Parenthood for one year after an anti-abortion group released videos over the summer showing officials discussing the transfer of fetal tissue.
Three moderate Republicans attempted Thursday to restore the funding to Planned Parenthood, but it fell short by three votes.
The bill goes even further than the version passed by the House by ending the law's Medicaid expansion and subsidies and getting rid of the tax increases imposed under the law.
Before the final vote, the Senate voted on a number of amendments including a series aimed at reducing gun violence in the wake of the San Bernardino, California shooting. All three gun amendments failed.
Republicans triggered the reconciliation process by passing a bicameral budget for the first time in a decade earlier this year. Democrats used the obscure budget procedure to pass Obamacare in 2009.
Speaker Paul Ryan, R-Wisconsin, meanwhile, vowed Thursday in his first major address as speaker for Republicans to offer an Obamacare replacement plan next year.