McCain, who had been recovering from surgery in Arizona
, flew to Washington and was greeted by a standing ovation on both sides of the aisle on the Senate floor when he arrived just minutes before 3 p.m. ET.
He waved and gave the thumbs up to reporters crowded in Capitol's hallways before casting his vote.
"I stand here today looking a little worse for the wear, I am sure," McCain said on the floor, with what appeared to be a stitched up incision over his left eye.
McCain was essential to advance the legislation. Senate Majority Leader Mitch McConnell could only afford to lose two votes of his 52-member conference in order to pass, and both Sens. Susan Collins of Maine and Lisa Murkwoski of Alaska voted against the step. Vice President Mike Pence had to break the 50-50 tie.
McCain spoke from the Senate floor following the vote, pleading with his colleagues to put partisanship aside and repeated his call to regular order, an apparent dig at his own party that skipped the regular procedure of allowing the health care bill to be debated in committee as well as holding hearings.
"We're getting nothing done my friends. We're getting nothing done," he said, adding, "All we've really done this year is confirm Neil Gorsuch to the Supreme Court."
He urged his colleagues to ignore "bombastic voices" on radio and television, saying "our incapacity is their livelihood."
"Let's trust each other," he added. "Let's return to regular order."
McCain's office announced Monday night that he would return -- a surprise to most in Washington who expected him to miss the crucial vote and return to Washington at a later date.
McCain underwent surgery to remove a blood clot earlier this month at Mayo Clinic Hospital in Phoenix. Lab results from that surgery confirmed the presence of brain cancer associated with the blood clot.
While he voted to proceed to debate on the bill, McCain emphatically stated that he will not vote for the bill as it now stands.
"It's a shell of a bill right now, and we all know that," he said, adding that his support hinges on whether the bill includes changes supported by his own governor. McCain has expressed concerns about Medicaid cuts in the bill, something many GOP governors have opposed.
McCain grew reflective on the role of the Senate and its deliberative nature. "We are not the President's subordinates," he said at one point. "We are his equal."
The senator said he'll be in town for a "few days," in part to oversee debate on the National Defense Authorization Act, a piece of legislation close to his heart given his role as the chairman of the Senate Armed Services Committee.
With that, he ended his speech with a touch of his widely-known sense of humor.
"I have every intention of returning here and giving many of you cause to regret all of the nice things you said 'bout me," he said. "And I hope to impress on you again that it is an honor to serve the American people in your company."