Mr. McCain quickly moved on to critique the current state of the Senate and his own role in a partisan, quarrelsome era of American governing. The Senate, Mr. McCain said, has not “been overburdened by greatness lately, they aren’t producing much for the American people. Both sides have let this happen.” In self-reproach he added, “Sometimes I’ve let my passion rule my reason, sometimes I made it harder to find common ground because of something harsh I said to a colleague.”
Mr. McCain cautioned his colleagues to ignore “bombastic” pundits. “To hell with them,” he said to applause as he implored his colleagues to work in a bipartisan manner — a provocative message after the hyperpartisan vote. (In all, 50 Republicans voted to take up the health care debate and 2 voted no. On the other side, 46 Democrats and 2 independents voted no.)
On social media, Mr. McCain took a beating in the 24 hours after he revealed that he would make the five-hour flight to Washington to vote for what many viewed as bill to take away health care from poor people when Mr. McCain was receiving the best care available. In 2008, Senator Edward M. Kennedy was suffering from the same tumor that has sickened Mr. McCain, and the Massachusetts Democrat made a surprise appearance to help Democrats break a filibuster they said would protect access to doctors by older Americans.
Over the last year, Mr. McCain, 80, has displayed every element of his disputatious, droll, scolding, informed, press-loving, press-hating, senatorial self. He has zipped around the world at a pace that has exhausted colleagues decades younger, attempting to assure allies rattled by President Trump’s tweets and remarks.
He has remained watchful and characteristically hawkish on all things Russia-related, even as his fellow Republicans have largely shied from the issue since Mr. Trump entered the White House. He has remained bizarrely captivated by the vexing problem of catfish inspection processes. He has cooperated loyally with party, except when he hasn’t. He brought down a Republican measure to end emissions curbs on methane because he was mad about the Trump administration’s choice for United States Trade Representative.
But his Teflon veneer showed cracks this spring when he seemed to be occasionally confused and at times more testy than usual. Last month, Mr. McCain seemed muddled while questioning James B. Comey, the former F.B.I. director, during a Senate hearing. Mr. McCain later said his befuddlement was because of a late night watching an Arizona Diamondbacks game. Last week, Mr. McCain was diagnosed with brain cancer.
It was striking enough that Mr. McCain, held and tortured for five years as a prisoner of war in Vietnam, returned dangerously sick to the Capitol to help put a health care bill over the line. It was stunning that he did it for Mr. Trump, who as a candidate derided Mr. McCain’s military service — “I like people who weren’t captured,’’ Mr. Trump said in July 2015 — and who ridiculed scores of policy and political conventions that Mr. McCain has embodied over a generation.
This was the John McCain who, rather than attend the 2016 Republican National Convention, chose instead to stomp around his home state, and to take a train to his beloved Grand Canyon.
On Tuesday morning, Senator Mitch McConnell of Kentucky, the majority leader, expressed his thanks on the Senate floor. “Senator McCain is a fighter,” he said. “That’s evidenced by his remarkable life of public service, just as it’s again evidenced by his quick return to the Senate this afternoon. I know he’s eager to get back to work, and we’ll all be very pleased to have him back with us.”
Mr. McCain does not expect the health care vote to be the culminations of his congressional career, which began when he won a House seat in 1982. It is Mr. McCain’s intense wish to oversee the annual Pentagon policy bill, and has repeatedly told Republican leaders he will manage the passage of the legislation.
“I’ve had so many people say such nice things about me recently that I think some of you must have me confused with someone else,” Mr. McCain said, suggesting that he would get the Pentagon bill moving in the next few days before going home for treatment. His colleagues rose to applaud him.
Mr. McCain, who will soon undergo treatment for his cancer, said he would be back. “I have every intention of returning here,” he said, “and giving all of you cause to regret all of the nice things you said about me.”