With the final minutes for the vote dwindling, the House watched intently on Tuesday night to see whether any more Republicans would defect on the resolution to impeach Alejandro N. Mayorkas, the homeland security secretary.
Three House Republicans had already cast votes against impeaching Mr. Mayorkas, and based on attendance at the previous vote, the G.O.P. could afford no more. The tally held steady, and it seemed the indictment that Republicans had promised their base for over a year — accusing Mr. Mayorkas of refusing to comply with the law and breaching the public trust related to a surge of migrants at the U.S. border with Mexico — could squeak by along party lines.
Then, like a scene out of a political thriller, Representative Al Green, Democrat of Texas, appeared at the last moment to cast a surprise ballot — from a wheelchair, wearing blue hospital clothing and tan socks. He voted no.
Mr. Green’s vote was decisive. It tied up the measure, 215 to 215, and handed a stunning defeat to Speaker Mike Johnson.
“I was determined to cast the vote long before — I had no idea how close it was going to be,” Mr. Green said in an interview on Tuesday night from his hospital bed, where he had returned shortly after voting. “I didn’t come assuming that my vote was going to make a difference. I came because it was personal.”
It was a remarkable save by Mr. Green, who was known around the Capitol for repeatedly defying Democratic leadership to push for the impeachment of Donald J. Trump during his presidency. He had tried three times to impeach Mr. Trump, and failed each time.
But on Tuesday night, Mr. Green, who rushed to the Capitol after undergoing emergency abdominal surgery on Friday, delivered the final blow, at least for now, for partisan impeachment charges that Democrats and constitutional law experts — including several conservatives — have said are based on policy disputes and not on the constitutional standard of high crimes and misdemeanors.
Mr. Green was still in the hospital on Tuesday recovering from surgery when he learned the House would vote on the impeachment charges against Mr. Mayorkas that night. He spoke to his doctors and phoned Representative Hakeem Jeffries, Democrat of New York and the minority leader, to let him know that he would take an Uber to the Capitol. Mr. Jeffries did not insist he make the vote, Mr. Green said, but arranged transportation for him.
“I had to cast this vote because this is a good, decent man whose reputation should not be besmirched,” Mr. Green said of Mr. Mayorkas.
He went straight to the attending physician’s office on the first floor of the Capitol, where his blood pressure and temperature were monitored. He insisted on being brought up for the impeachment vote — “not to make a dramatic entrance,” he said, but because “this was a vote that was important to me.”
While he was sitting on the House floor, Mr. Green said, Representative David Scott, Democrat of Georgia, turned around to tell him he had tied the vote. “I hadn’t even given thought to what that meant,” Mr. Green said.
Mr. Green did not cast a vote on an unrelated bill immediately preceding the impeachment resolution, in what appeared to be an attempt to keep Republicans guessing.
It seemed to work.
Representative Marjorie Taylor Greene, Republican of Georgia and a vocal proponent of the drive for Mr. Mayorkas’s impeachment, accused Democrats of playing a “game” and having Mr. Green withhold his earlier vote to lull Republicans into a false sense of security.
“They hid one of their members, waiting to the last minute, watching to see our votes, trying to throw us off on the numbers that we had versus the numbers they had,” Ms. Greene told reporters on the steps of the Capitol after the vote. “So, yeah, that was a strategy at play tonight.”
Mr. Green denied timing his entrance to trick Republicans, explaining that he assumed that the vote would be tight but that Republicans would prevail since they had chosen to bring the resolution onto the floor.
“Under the Pelosi school of politics, you don’t bring it to the floor if you’re not going to pass it,” Mr. Green said, referring to Representative Nancy Pelosi, Democrat of California and the former speaker.
Mr. Johnson, who stood at the dais with the gavel in his hand, held the vote open for several more minutes, scrambling to find a way to save the measure. Democrats repeatedly yelled, “Order!” and booed as the vote dragged on.
In the end, Representative Blake Moore of Utah, a member of the Republican leadership, flipped his vote to allow the party to bring the resolution up again at a later time — when leaders hope they will have the votes.
“I have been blessed with good surgeons, and I’ll be here for a while longer,” Mr. Green said while hanging up the phone from his hospital bed. “I’m going to take care now. I’m going to be a better patient.”
Catie Edmondson, Carl Hulse and Luke Broadwater contributed reporting.