Washington (CNN) -- He spent more than 21 straight hours railing against any government funding for Obamacare. Then Republican Sen. Ted Cruz of Texas joined the other 99 senators from both parties in voting Wednesday to move ahead on a spending plan expected to do just that.
The rare 100-0 vote on a procedural step means the spending measure needed to avoid a partial government shutdown next week now can be amended by Senate Democrats to restore funding for President Barack Obama's signature health care reforms that had been eliminated last week by House Republicans.
Cruz had led a group of tea party conservatives in trying to block Senate consideration of the spending legislation because of the stated plan by Democratic Majority Leader Harry Reid to strip it of the provision that defunded Obamacare.
Cruz: Speech to last until I can't stand Cruz's war on Obamacare Santorum: 'I would be with Ted Cruz' Rep. Peter King: Cruz 'a fraud'
Photos: Texas junior Senator Ted Cruz Photos: Texas junior Senator Ted Cruz
He came under strong criticism from fellow Republicans for a strategy that essentially called for GOP senators to filibuster the House measure, even though it denied any funding for reforms under the Affordable Care Act passed in 2010 and upheld by the Supreme Court last year.
Fed up over Beltway shutdown battle
The confusion of Cruz's strategy was apparent Wednesday when he voted for the Senate to take up the measure less than two hours after ending his speech against it that began Tuesday afternoon and continued overnight and through the morning.
An aide to Cruz told CNN Chief Congressional Correspondent Dana Bash that the senator always intended to allow formal consideration of the House measure. The aide said Cruz would vote against it once Senate Democrats restore the Obamacare funding.
However, nothing in Cruz's words or actions preceding the vote indicated that was his intention. Instead, he had urged his colleagues to unite against the spending plan, saying voting for it was tantamount to supporting Obamacare.
"Any senator who votes (to move forward with debate on the House bill) is voting to give Harry Reid the authority to fund Obamacare," Cruz told Bash on Monday.
Cruz and other tea party conservatives wanted to prevent the Senate from taking up the spending measure passed last week by the GOP-controlled House that makes continued government funding contingent on denying any money for Obamacare.
How this affects you
While his marathon speech did not constitute a filibuster, it was intended to rally opposition to the Senate's expected amendments that would restore the Obamacare funding.
However, he lacked support for his tactics from Senate Republican leader Mitch McConnell of Kentucky and other influential veterans including Sens. John McCain of Arizona and Bob Corker of Tennessee.
In the end, Cruz joined them in opening the spending plan to revisions by the Democratic-led chamber.
Harry Reid called Cruz's all-night speech a "waste of time" as the nation faced a possible partial shutdown of the government if Congress fails to authorize government spending beyond Monday, when the current fiscal year ends.
To Reid, the tactic reflected what he described as a perspective that a "bad day for government" amounted to a "good day" for tea party conservatives.
Earlier Wednesday, Corker told CNN that a better idea would be to get the bill back to the House as soon as possible so the Republican majority there can offer a compromise.
"House members are already talking about how they might respond if the defunding component ends up being stripped out," Corker said, adding he hoped that the Senate would "give the House some time to respond in a thoughtful way."
With Obamacare markets for the uninsured set to open on October 1, which also begins the new fiscal year, a possible GOP counter-proposal floated by Corker would delay it for a year. He noted that Obama already put off another component affecting business implementation of health care reforms for a year.
Under the process planned by Reid, a final Senate vote on the revised spending plan would occur over the weekend to leave the House a day at most to reconsider it. However, Reid said Wednesday he wanted the Senate to complete its work on the measure as soon as possible.
Cruz, as he approached the conclusion of his overnight speech, thanked the Senate staff and others "who have endured this Bataan death march."
He filled the hours of his speech with a blend of political rhetoric and emotional pleas for Republicans like Corker to unite in opposition to Obamacare.
Darth Vader, Sean Connery, Chinese gooseberries and other highlights
Conservative colleagues including Sen. Mike Lee of Utah, Marco Rubio of Florida, David Vitter of Louisiana and James Inhofe of Oklahoma joined him at times to assume the main talking duties and allow Cruz to rest his vocal chords.
As he reached 18 hours of holding the Senate floor, Cruz compared his anti-Obamacare effort to the "Star Wars" films.
Referring to having heard someone use the phrase "rebellion against oppression," Cruz said those words "conjured up to me the rebel alliance fighting against the empire. The empire being the Washington, D.C., establishment."
"And indeed immediately on hearing that phrase I wondered if at some point we would see a tall gentleman in a mechanical breathing apparatus come forward and say in a deep voice, `Mike Lee, I am your father.' "
Cruz said his effort "is a fight to restore freedom to the people. This is a fight to get the Washington establishment, the empire, to listen to the people. And just like in the 'Star Wars' movies the empire will strike back. But at the end of the day I think the rebel alliance, I think the people will prevail."
Those remarks came at about 8:40 a.m. Cruz began speaking at about 2:40 p.m. Tuesday.
Cruz also called for Senate Republicans to show the same courage as their party colleagues in the House in making a stand to defund Obamacare.
He alluded to the risks faced by the signers of the Declaration of Independence, noting they were mostly wealthy landowners who faced hanging for treason for their actions.
When he began, Cruz said he intended to "speak in support of defunding Obamacare until I am no longer able to stand."
On Tuesday night, he read the Dr. Seuss children's classic "Green Eggs and Ham" to his daughters.
At 9 a.m. Wednesday, Cruz was alone on the floor, except for the presiding officer, Democratic Sen. Dick Durbin.
Durbin and Cruz engaged in some hostile exchanges, with the Illinois Democrat accusing Cruz of trying to deny health care coverage for tens of millions of currently uninsured Americans while enjoying the benefits of a federal health care program.
Cruz responded that Obamacare was flawed and hurting the country, and the focus should be on a better solution instead of continuing on with a failed system.
Earlier, Cruz sought to define his battle as purely about principle, saying: "This fight is not about any member of this body. This fight is not about personalities."
"Look, most Americans could not give a flying flip about a bunch of politicians in Washington," he said. "Who cares? Almost all of us are in cheap suits with bad haircuts! Who cares?"
Supporters cheered him on through social media, and #StandWithCruz became one of the most popular hashtags on Twitter.
But supporters of the health care law made themselves heard as well. On Wednesday morning, the two sides were battling it out in the top trending topic in the United States: "Obamacare."
Cruz also has been the target of criticism by some top Republicans.
GOP infighting over how best to prevent a government shutdown while defunding Obamacare escalated Tuesday as McConnell publicly dismissed Cruz's more confrontational strategy.
Cruz's GOP critics believe his strategy is politically suicidal, arguing there is no way to stop Obamacare as long as Democrats maintain control of the Senate and Obama is in the White House.
They believe that trying to do so by forcing a shutdown -- or preventing an increase in the debt ceiling next month -- will backfire by harming the economy and damaging the Republican brand.