The first Senate proposal to repeal and replace Obamacare was defeated by an unexpected wide margin Tuesday evening.

Nine Republicans opposed the plan, which was a combination of Senate leadership’s most recent replacement bill plus amendments from Texas Sen. Ted Cruz and Ohio Sen. Rob Portman.

In some ways this vote was a trial balloon. It was the first of at least two votes necessary on that plan. And it was never expected to pass because the two amendments were not eligible for the Senate’s special reconciliation process and thus needed 60 votes to pass. Republicans hold only 52 seats in the Senate. Still, that nine Republican senators voted against the bill was an unexpected blow to repeal plans.

One move that surprised many was Sen. John McCain’s vote in favor of the amended bill, given his comments earlier in the day. Tuesday afternoon McCain had flown into Washington, after undergoing surgery and being diagnosed with a brain tumor, in order to pass the crucial vote on a motion to allow the GOP health plans to go to a vote.

At the time, McCain warned that while he was voting for the motion he would not necessarily vote for the final bill. “I will not vote for this bill as it is today. It is a shell of a bill right now, we all know that,” he said.

But it wasn’t clear whether McCain was talking about the leadership bill itself, the amended leadership bill with both the Cruz and Portman proposals attached, or another of the various health care plans floating around the Capitol. Even after voting to move the amended leadership bill forward Tuesday evening he said that he wasn’t necessarily supporting the bill itself. Technically, the vote was not on the bill but on letting Republicans vote to pass the bill with a 50-vote threshold instead of the typical 60 votes. “I just thought it would be good to move the process forward, and then we'll see what happens later on,” said McCain.

Republicans will have several more chances over the rest of the week to pass different variations of bills to repeal Obamacare. But none can pass without at least 50 votes. Tuesday evening’s version failed by a vote of 43 to 57, a surprisingly forceful show of opposition.

Following Tuesday night’s vote, however, the Cruz and Portman plans are certainly dead. The Cruz amendment would have allowed insurance companies to provide plans free from all Obamacare rules — letting them charge sick people more or reject them altogether — as long as they also offered Obamacare-compliant plans in the same area. The Portman amendment would have preserved more federal money for Medicaid spending.

The senators voting against the amended bill included members of the hardline conservative wing concerned the bill didn’t go far enough (Rand Paul and Mike Lee) and the more moderate wing concerned the bill went too far (Dean Heller, Susan Collins, Lisa Murkowski). And it included senators who were previously thought to be both difficult to win over (Jerry Moran) and reliable yes votes (Bob Corker, Lindsey Graham, Tom Cotton).

Republicans can still get at least three more kicks at the can. There will likely be a vote on the leadership bill without the Cruz and Portman amendments, which will require only 50 votes to pass (with Vice President Mike Pence breaking the 50-50 tie). There is also a 2015 “straight repeal” bill that does away with the provisions of Obamacare with a two-year delay, giving Congress time to pass a replacement plan. Then there is the option of a so-called “skinny” repeal plan that just does away with Obamacare’s individual mandate to buy insurance and some taxes.

But it remains unclear whether Republicans can get to the necessary 50 votes on any one of those three plans.

“I would much prefer that we return to committee and go through the normal order. I do believe there’s significant flaws in Obamacare as the collapse of markets shows, but I don’t think this is the best approach,” Sen. Collins said, after voting no Tuesday night.

Tuesday’s failure means the first Obamacare repeal proposal is dead. The Senate will vote on a series of amendments from both Republicans and Democrats in the coming days.

If the Senate does manage to pass a bill to repeal and/or replace Obamacare, it will still need to get approval from the House before it can become law.

Lissandra Villa contributed to this story.