WASHINGTON — Sen. John McCain declared his opposition Friday to the GOP’s last-ditch effort to repeal and replace “Obamacare,” dealing a likely death blow to the legislation and, perhaps, to the Republican Party’s years of vows to kill the program.

“I cannot in good conscience vote for the Graham-Cassidy proposal,” McCain said in a statement, referring to the bill by Sens. Lindsey Graham of South Carolina and Bill Cassidy of Louisiana.

“I believe we could do better working together, Republicans and Democrats, and have not yet really tried,” he said. “Nor could I support it without knowing how much it will cost, how it will affect insurance premiums, and how many people will be helped or hurt by it.”

McCain was the decisive vote against the GOP’s last repeal effort, in July. Once again, the 81-year-old senator, battling brain cancer in the twilight of a remarkable career, emerged as the destroyer of his own party’s signature promise to voters.

President Donald Trump and Senate Majority Leader Mitch McConnell had both been pushing hard for the bill in recent days, and McCain’s best friend in the Senate, Graham, was an author. Trump declared during the presidential campaign that he would quickly demolish Obamacare and “it will be easy.”

McCain’s announcement likely leaves GOP leaders at least one vote short for the bill, which they had hoped to bring to the floor next week. They face a Sept. 30 deadline for action on the legislation, at which point special rules that prevent a Democratic filibuster will expire.

Democrats are unanimously opposed. GOP Sen. Rand Paul of Kentucky has announced his opposition and GOP Sen. Susan Collins of Maine said Friday she, too, was leaning against supporting the bill.

Along with McCain, that would leave Republicans with only 49 votes for the bill; they would need 50, plus Vice President Mike Pence to break a tie, in order to prevail.

The Graham-Cassidy bill would repeal major pillars of former President Barack Obama’s law, replacing them with block grants to states to design their own programs. Major medical groups are opposed, saying millions would lose insurance coverage and protections.