The Senate on Wednesday rejected an effort by Democrats block the Trump administration from promoting short-term healthcare plans as an alternative to Obamacare.

Though the measure received the support of all 49 Democratic senators, it failed to gain the two Republican votes necessary, as only Sen. Susan Collins, R-Maine, voted in favor. The Senate voted 50-50 on the measure, not quite the majority it needed to pass.

The legislative maneuver was part of Democrats’ ongoing strategy to keep healthcare at the center of the conversation ahead of the Nov. 6 midterm elections, and to force Republicans to take a difficult vote on Obamacare.

The vote was on a discharge petition by Sen. Tammy Baldwin, D-Wis., to block health insurance companies from selling short-term plans, a type of coverage extended under President Trump as an alternative to Obamacare plans that Democrats and the healthcare law's allies deride as “junk insurance.” Democrats were able to force the vote through the Congressional Review Act, which allows Congress to cancel administration rules with a simple majority vote.

The measure would have faced unlikely passage in the House, and the White House had said in a statement of administration policy Tuesday that President Trump would veto it.

Under the Trump administration’s rules, which went into effect last week, people are allowed to buy short-term health insurance plans for up to a year, and renew them twice for up to two years. The plans were allowed to be sold until up to a year until former President Barack Obama’s final year in office, but were shortened in order to try to compel more people to join the Obamacare exchanges instead.

Democrats and pro-Obamacare allies framed Wednesday's vote as a reckoning on Republicans' commitment to protecting people with pre-existing medical conditions, such as cancer, diabetes, and asthma. The Trump-promoted plans aren't required to cover applicants with pre-existing conditions and can exclude coverage for mental health, maternity care, or prescription drugs.

Baldwin, who is up for re-election, said on the Senate floor Wednesday that her latest move was part of her effort to stop the Republican "sabotage" on healthcare.

"These junk plans will reduce access to quality plans for millions and increase costs," Baldwin said.

"If Republicans are serious about standing with people for pre-existing conditions, they will join us to pass this bill and fight for them," Sen. Patty Murray, D-Wash., said from the Senate floor.

Obamacare made it illegal for health insurers to turn people away because of these types of conditions, or to charge them more because of their illness. Democrats have argued that because Republicans sought to undo the healthcare law they are not committed to protecting the sick.

Senate Minority Leader Chuck Schumer, D-N.Y., said from the Senate floor Wednesday that Republicans wanted to "wrench our country back to a time when ... insurance companies could do whatever they wanted."

Republicans have countered that Obamacare's rules have raised prices of premiums and caused people to forego coverage. They have said people should have the option to choose what kind of coverage they want.

Sen. Lamar Alexander, R-Tenn., said on the Senate floor Wednesday that supporting the measure from Democrats was equivalent to telling voters who only have Obamacare as an option that their coverage would continue to be unaffordable. He noted that people who have subsidies under Obamacare are likely to stick with those plans.

"At least, you will have some insurance," he said of the option people who don't have subsidies will have under the short-term plan rule.

Collins, the lone Republican who sided with Democrats, said that she agreed that there were affordability issues in Obamacare.

"I don't think the answer is to wipe out consumer protections for people with pre-existing protections," she told reporters.

Robert King contributed to this report.