Updated

The Senate voted Wednesday to advance a controversial bill that would both avert a government shutdown while defunding ObamaCare, after Sen. Ted Cruz delivered a marathon 21-hour speech in a bid to rally public opposition to the health care law.

Despite Cruz's efforts, Senate Democratic Leader Harry Reid was moving swiftly to try and strike the ObamaCare language, leaving only a stopgap spending bill that would keep the government open until mid-November. Reid teed up another test vote for Friday, leaving more standoffs with Republicans on the horizon in both chambers.

Without an agreement, the government will partially shut down on Oct. 1, but some Republicans continue to demand that the health law be de-funded in exchange for a budget bill.

"ObamaCare isn't working," Cruz said Wednesday, as he departed the Senate floor after speaking in opposition to the law from Tuesday afternoon straight through until noon on Wednesday.

Reid countered that his floor speech was a "big waste of time" and only brought the government closer to a shutdown.

More On This...

    "With all due respect, I'm not sure we learned anything new," Reid said.

    Cruz's speech was a symbolic stand, as he was not actually able to stall the bill at this point. In the end, he and every other senator voted to advance the bill and proceed to debate. The vote was 100-0. But Cruz, anticipating that Reid will re-fund ObamaCare, is trying to rally Republicans and moderate Democrats to join in blocking the bill before it comes to a final vote. Another test vote, which will require 60 senators to proceed, is expected on Friday.

    What comes next is a complicated set of procedural maneuvers, with no clear outcome.

    Reid hopes to put up a clean bill that simply keeps the government open past Sept. 30, and send it the House by the end of the weekend. If Reid can muster the votes, majority Republicans in the House will then have to decide whether to stand by their demand that the health law be defunded and risk a government shutdown, or pass the Senate bill -- in turn keeping the government open, but allowing key parts of the controversial health law to launch in early October.

    Speaking in support of the health law, Sen. Charles Schumer, D-N.Y., claimed his party is in a better position going into the final stretch before the end-of-the-month deadline.

    "Senator Cruz has actually advanced our cause. He has alienated some of his colleagues. He has united Democrats. And he has shown the American people he is willing to hold them and their wellbeing hostage unless he gets his way," he said.

    From Tuesday afternoon until noon on Wednesday, Cruz -- with occasional remarks by Sen. Mike Lee, R-Utah, and other GOP conservatives -- controlled the Senate floor and railed against ObamaCare. At 10:41 a.m. EDT Wednesday, Cruz and his allies reached the 20-hour mark, the fourth-longest Senate speech since precise record-keeping began in 1900.

    That exceeded March's 12-hour, 52-minute speech by Sen. Rand Paul, R-Ky., like Cruz a tea party lawmaker and potential 2016 presidential contender, and filibusters by such Senate icons as Huey Long of Louisiana and Robert Byrd of West Virginia.

    Cruz said he has learned that defying party leaders is "survivable," adding, "Ultimately, it is liberating" and that his long evening involved "sometimes some pain, sometimes fatigue."

    But he added, "You know what? There's far more pain in rolling over. ... Far more pain in not standing up for principle."

    The Associated Press contributed to this report.