House Television, via Associated Press

The clock was running down, and the debt ceiling compromise did not yet have enough ayes to pass. Then, slowly, applause started trickling through the House chamber. The clapping grew over the next half minute, until finally, the person who somehow managed to draw universal admiration from the frayed body came into view.

Representative Gabrielle Giffords made a surprise appearance Monday evening on the floor of the House of Representatives, the first time she has returned to Washington since she was shot earlier this year in Arizona.

With two minutes remaining on the voting clock, Ms. Giffords entered the chamber through a side door. Her arrival prompted a standing ovation that lasted throughout the remainder of the vote on the compromise to raise the debt ceiling. She was ne of the last representatives to cast her ballot, voting yes on the measure as other affirmative votes put the bill over the top.

“Gabby is voting to support the bipartisan debt-ceiling compromise,” said a post on her Facebook page. “This is a huge step in her recovery, and an example of what we all know — she is determined to get better, and to serve CD8 and our nation. This vote — expected to be very close — was simply too important for her to miss.”

Ms. Giffords waved and quickly was surrounded by her Democratic colleagues. Some Republicans crossed the aisle to see her, too, as she rose to wave again.

Representative Nancy Pelosi of California, the minority leader, hailed the return of Ms. Giffords, saying: “There isn’t a name that stirs more love, more admiration, more respect, more wishing for our daughters to be like her than the name of Congresswoman Gabby Giffords. Thank you, Gabby.”

The dramatic arrival capped a day of anticipation on Capitol Hill. She was accompanied by her husband, the astronaut Mark E. Kelly. She left the chamber, walking slowly, but under her own power. Her Twitter account, which has featured dispatches from her staff since she was shot in the head at a Tucson political event in January, finally featured a message from its owner:



The #Capitol looks beautiful and I am honored to be at work tonight. Gabrielle Giffords

Rep_Giffords

Representative Steny Hoyer of Maryland, the Democratic whip, said he learned of Ms. Giffords’s arrival about 30 minutes before she walked onto the House floor. He said he believed that she had flown on a government plane to Washington.

“It was very heartening to see her,” Mr. Hoyer said. “She wanted to be with her colleagues as she was at the beginning of the year.”

Her return came about at the last minute, as the congresswoman watched the debt debate from her home in Arizona, said Representative Debbie Wasserman Schultz, a close friend.

Ms. Wasserman Schultz said Mr. Kelly called her late Sunday night with a question: how close was the vote? He said Ms. Giffords wanted to be at the Capitol if her yes vote would be needed.

It wasn’t, Ms. Wasserman Schultz said. But in several conversations late into the night, it became clear that Ms. Giffords wanted to come anyway. In the morning, she tagged along with her husband, who was already planning on a trip to Washington for the week.

“She decided that if it’s not pivotal, it’s important to her constituents that she be there for the vote,” Ms. Wasserman Schultz said. “She would be a yes vote, she said, and she wanted to cast a vote.”

Ms. Wasserman Schultz said Ms. Giffords arrived at around 4:30 p.m. Eastern time, just a couple of hours before the vote. Ms. Wasserman Schultz kept the secret close, telling her closest aides only a few minutes before the vote was to take place.

The two colleagues and friends met outside the Capitol just before the vote and then entered the chamber to thunderous applause.

“The room just exploded,” said Ms. Wasserman Schultz, recalling the moment that she looked up to see the light by Ms. Giffords’s name light up when she cast her vote. “We’ve all seen her empty light and we all wanted to see her name light up.”

Ms. Wasserman Schultz, chairwoman of the Democratic National Committee, said the moment was a salve for the weary and frustrated lawmakers who have been engaged in an angry fight over the debt ceiling for weeks.

“Everybody’s heart was so grizzled and hardened,” she said. When she walked into the room, “everybody’s heart just melted.”

Ms. Giffords smiled as she moved through a crowded hallway. She did not answer questions, but raised her hand to wave as she walked into a waiting elevator. She wore a teal shirt and thick glasses, her brown hair cropped short — a contrast from the longer style she wore before the shooting — but her smile was remarkably similar.