For the first time ever, the Republican-controlled Senate tonight passed a bill that essentially repeals the Affordable Care Act (ACA) except for one small detail — President Barack Obama plans to veto it.

Among other things, the bill would prevent the federal government from running healthcare exchanges, eliminate insurance subsidies, repeal Medicaid expansion now underway in 30 states and junk the law's especially controversial requirements that most individuals obtain health insurance coverage and that large employers offer their employees the same. It also would block federal funding for Planned Parenthood for 1 year, a lightning rod issue in the wake of last month's shooting at a Planned Parenthood clinic in Colorado Springs that left three people dead.

The bill, called the Restoring Americans' Healthcare Freedom Reconciliation Act of 2015, won House approval in October. It only needed 51 votes for passage in the Republican-controlled Senate — not the usual 60 to overcome an opposing party's filibuster — because it went through a special budget reconciliation process.

The final vote in the Senate was 52 to 47 along party lines. It now goes back to the House for a second vote because the Senate amended the original bill.

The Senate had long known that Obama would veto anything that gutted the signature legislation of his presidency. Noting that the House for its part has tried to erase or cripple the ACA more than 50 times, the White House recently said in a statement that the latest repeal measure would "take away critical benefits and healthcare coverage from hard-working middle-class families." An estimated 17.6 million Americans gained coverage under the law since its inception, the administration said.

The White House also warned against eliminating ACA provisions that would "slow the growth of healthcare spending and improve quality."

Senate Majority Leader Mitch McConnell (R-KY) countered on the floor of the Senate today that "Obamacare is a direct attack on the middle class."

"Americans are living with the consequences of this broken law and its broken promises every day," McConnell said.

Although facing an Obama veto, Congressional Republicans could resurrect this legislation if one of their own is elected president in 2016 and is willing to sign the measure.