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 that would 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, which had been eliminated last week by House Republicans.
Cruz led a group of tea party conservatives in trying to block Senate consideration of the spending legislation because Democratic Majority Leader Harry Reid made clear his caucus would remove the provision that defunded Obamacare.
However, Cruz came under strong criticism from fellow Republicans for that strategy, which called for GOP senators to filibuster the House measure that -- in its original form -- would defund programs under the Affordable Care Act passed in 2010 and upheld by the Supreme Court last year.
The confusion of Cruz's strategy was apparent Wednesday when he voted with Democrats for the Senate to take up the measure less than two hours after his marathon 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, adding that Cruz would vote against it once Senate Democrats restored 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 measure) is voting to give Harry Reid the authority to fund Obamacare," Cruz told Bash on Monday.
After Wednesday's vote, Cruz told reporters that his long night sought to unite Republicans to block any funding for Obamacare.
"Coming into this debate we clearly were not united," he said. "There were significant divisions in the conference. I hope those divisions dissolve; that we come together in party unity" with all 46 Republicans preventing a final vote on the spending plan once Democrats amend it to fund Obamacare.
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.
While his drawn-out floor speech did not constitute a filibuster, it was intended to rally opposition to the state goal of Senate Democrats to restore the Obamacare funding.
However, Cruz 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 voted with them to open the spending plan to revisions by the Democratic-led chamber.
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 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, GOP opponents consider this their last best chance to undermine or amend the health care reforms.
A possible GOP counter-proposal floated by Corker would delay its full implementation for a year. He noted that Obama already postponed 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."
When he began at 2:40 p.m. Tuesday, Cruz said he intended to "speak in support of defunding Obamacare until I am no longer able to stand."
He filled the ensuing hours with a blend of political rhetoric and emotional pleas for Republicans like Corker to unite in opposition to Obamacare.\
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.
'Green Eggs and Ham' gets a reading
On Tuesday night, he read the Dr. Seuss children's classic "Green Eggs and Ham" to his daughters.
As he reached 18 hours of holding the Senate floor on Wednesday morning, 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."
Later, he 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.
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.
Two sides battle it out on social media
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."
Key Republicans critical of Cruz strategy
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.
The Treasury Department said Wednesday that the debt ceiling -- which is the amount the federal government can borrow to pay its bills -- must be raised by October 17 to prevent a possible default.
House Republicans say they will propose a package of measures that includes a one-year delay in full implementation of Obamacare to a proposal to extend the debt limit for a year. House Republican leaders met Wednesday evening to discuss the policy priorities they plan to attach.
But there are signs leadership is running into resistance from conservatives, some of whom do not want additional borrowing. Others want to add new items while others still question the strategy of taking up the debt bill in the middle of fight over spending and a possible government shutdown.
The White House rejects negotiations on the debt issue, saying something as fundamental as ensuring the good credit of the United States must be above politics.
The last debt ceiling fight in Congress in 2011 caused the first-ever downgrade of the U.S. credit rating and Obama and top Democrats warn playing politics with the issue now will cause economic harm amid the still fragile recovery.
CNN's Paul Courson, Deirdre Walsh, Virginia Nicolaidis, Ted Barrett and Paul Steinhauser contributed to this report.