Sen. John McCain (R-Ariz.) on Friday announced that he will vote against the latest proposal to repeal ObamaCare, potentially dooming the legislation and, with it, the GOP's last shot at passing a health-care overhaul this year.

"I cannot in good conscience vote for the Graham-Cassidy proposal. I believe we could do better working together, Republicans and Democrats, and have not yet really tried," he said in a statement, referring to the legislation spearheaded by GOP Sens. Lindsey Graham (S.C) and Bill Cassidy (La.).

Republicans have been racing toward a vote on health care next week, ahead of a Sept. 30 deadline for approving the bill on a majority vote.

They had been hopeful that McCain's close friendship with Graham and the support for the bill from Arizona's governor would be enough to win him over.

McCain suggested the decision had weighed on him, adding that he takes "no pleasure" in it.

"The bill's authors are my dear friends, and I think the world of them. I know they are acting consistently with their beliefs and sense of what is best for the country. So am I," he said.

Graham quickly weighed in on McCain's decision, saying he disagrees but their friendship will survive.

"My friendship with John McCain is not based on how he votes but respect for how he's lived his life and the person he is," he said on Twitter.

Graham added that "I respectfully disagree" with McCain and "intend to push forward for state-centric health care vs Washington-knows-best health care."

Cassidy said he was "disappointed" in McCain's decision but pledged that he would continue to work for families "being penalized because they can't afford insurance."

Supporters of Graham-Cassidy, which is also co-sponsored by Republican Sens. Ron Johnson (Wis.) and Dean Heller (Nev.), argue that it's the GOP's last chance to keep their promise to roll back former President Obama's signature law.

The bill seeks to give more power to the states by converting dollars currently spent on ObamaCare's subsidies and Medicaid expansion into block grants to states. The bill would also allow states to waive ObamaCare regulations, including those protecting people with pre-existing conditions from being charged higher premiums.

Though McCain's opposition doesn't formally kill the legislation, it leaves leadership with a daunting task: Winning over every other member of a caucus that includes both moderates and firebrand conservatives.

Sen. Rand Paul (R-Ky.) has already said he opposes the bill because it doesn't go far enough in repealing ObamaCare.

Other senators fear the bill's impact on state budgets and insurance coverage. Sen. Susan Collins (R-Maine) on Friday said she is "leaning against" the bill, and several other key senators - including GOP Sen. Lisa Murkowski (Alaska) - remain on the fence.

Three "no" votes would be enough to kill the legislation.

Senate Majority Leader Mitch McConnell (R-Ky.) earlier this week said he intends to hold a vote on Graham-Cassidy next week, but McCain's announcement throws those plans in doubt.

Sen. Joni Ernst (R-Iowa), speaking at a town hall in Iowa City, floated that next week's vote could be pulled.

"I'll be honest, it seems unlikely that we'll be voting on this," she said, according to The Washington Post.

Republicans had been open with their skepticism that the Graham-Cassidy legislation could get the needed 50 votes.

Sen. Chuck Grassley (R-Iowa) told Iowa reporters that Republicans were still at least two votes short "and I don't see those other one or two votes coming."

And Sen. Ted Cruz (R-Texas) told conservative radio host Michael Berry that "it's not clear if we're going to get to 50 votes or not."

McCain, who has brain cancer, cast the decisive vote that halted the GOP's first ObamaCare repeal effort over the summer. With a dramatic thumbs down on the Senate floor, he stopped that legislation in its tracks.

Murkowski and Collins also voted against that "skinny" repeal bill.

McCain at the time complained the legislation had been rushed to the floor without going through the normal committee process, and he leveled that same complaint against Graham-Cassidy.

"I would consider supporting legislation similar to that offered by my friends Senators Graham and Cassidy were it the product of extensive hearings, debate and amendment. But that has not been the case. Instead, the specter of [the] Sept. 30 budget reconciliation deadline has hung over this entire process," he said on Friday.

McCain also said he couldn't back the bill without seeing a full analysis from the nonpartisan Congressional Budget Office (CBO).

Without a CBO score, McCain said, lawmakers have no "reliable answers" to questions about how much the bill will cost, how many people will be covered and how it will affect insurance premiums.

The CBO has said its analysis won't be ready until next month.

McCain urged his colleagues to try to craft a bipartisan healthcare bill using "regular order."

"We should not be content to pass health-care legislation on a party-line basis, as Democrats did when they rammed Obamacare through Congress in 2009. If we do so, our success could be as short-lived as theirs," he said.

Sens. Lamar Alexander (R-Tenn.) and Patty Murray (D-Wash.) had been leading bipartisan talks to try to get a deal on a bill that would stabilize the individual insurance market.

But those talks were put on hold earlier this week after the White House and Speaker Paul Ryan (R-Wis.) warned they would not support a bill stabilizing ObamaCare.

McCain said Alexander and Murray had been "negotiating in good faith" and urged them to resume their talks if a third GOP senator comes out against the ObamaCare repeal bill.

"I fear that the prospect of one last attempt at a strictly Republican bill has left the impression that their efforts cannot succeed," he said. "I hope they will resume their work should this last attempt at a partisan solution fail."

Senate Democratic leader Charles Schumer (N.Y.) expressed a similar hope.

"John McCain shows the same courage in Congress that he showed when he was a naval aviator," Schumer said. "I have assured Senator McCain that as soon as repeal is off the table, we Democrats are intent on resuming the bipartisan process."

Late-night comedian Jimmy Kimmel, who has been waging a crusade against the Graham-Cassidy bill, hailed McCain as a hero.

- This report was updated at 3:20 p.m.