There were still eight hours and 46 minutes left in Jimmy Carter's presidency when word reached the White House before dawn yesterday that the solution to the last snarl in 14 1/2 months of hostage neogtiations was finally at hand.

After 16 hours of stalemate Monday that had just about deflated the Carter administration's hopes for a resolution before Ronald Reagan's inauguration, the sudden report from Deputy Secretary of State Warren Christopher in Algiers sparked the haggard, exhausted Carter people to make a last race against the clock.

All night new reports trickled in from Aliers, Tehran and London. Each one completed one more link in the convoluted chain of developments required to seal an accord between two governments that apparently distrust one another completely.

By dawn, the hostages" freedom seemed nearly certain; by mid-morning, an ageeement was clearly within reach. As President Carter was riding down Pennsylvania Avenue to Reagan's inauguration, he was told that the hostages would be flown out of Tehran within minutes.

But time ran out on Carter. There was a new president when the hostages finally were freed; the joyful news that the 52 Americans were coming home was announced, as Carter's press secretary, Jody Powell, noted dryly, by "the new folks."

Jimmy Carter's last night of grappling with the hostage crisis came as his presidency was literally folding up around him.

As Carter waited in the Oval Office all night Monday for news, servants in the White House family quarters packed the last of the Carter's belongings. In the parking lot outside, workmen were busy far into the night loading file cabinets on moving vans. Around the West Wing, staff assistants and secretaries were cleaning out their drawers (one found an "urgent" memo she had lost three years ago) and taking down pictures.

The outgoing president spent the early part of the evening with his wife in the family quarters of the White House. Around 9 p.m. he went to the Oval Office with Vice President Mondale, aide Hamilton Jordan and Atlanta lawyer Charles Kirko to keep track of what was then a desultory negotiation.

Judging from comments of his staff, the president and his advisers, entering a second long night without sleep, were in a desultory mood themselves. Press secretary Powell, who had stayed on the job all day to report any break-throughs, gave up and went home for a nap.

Shortly after 1 a.m. yesterday, with 11 hours remaining in Carter's term, Powell was back on the job, now reporting in happy, confident tones that the single clause responsible for the stalemate -- a portion of the "transfer authority" document governing the movement of frozen Iranian funds from U.S. banks to an escrow account in London -- was nothing more than an "itty-bitty hang-up."

The hang-up was resolved within the next two hours, according to the White House, when Roger Brown, a London attorney representing Iran's Central Bank, worked out new terms for the "transfer authority" clause. At the Treasury Department here, representatives of the 12 American banks holding Iranian deposits accepted Brown's language.

At 3:16 a.m., Christopher reported from Algiers that the Iranians had also accepted Brown's proposal. This was the breakthrough that could end the stalemate, and now the Carter people began to hope again that the hostages might leave Iran on Jimmy Carter's watch. Spirits were high; Powell, talking about Brown's role, joked that "there are more lawyers than there are ounces of gold in this thing. And all of them are going to make several."

One thing was not a laughing matter, though: the fear that Iran would deliberately delay the release to deny Carter his hoped-for finale. When Powell was asked if Iran might do that, he had short reply: "How the f--- would I know?"

The night wore on. At irregular intervals, new developments were reported. At 5:30 a.m., the 12 U.S. bankers reported that they had had passed the Iranian deposits to the Federal Reserve; at 6:47 the Federal Reserve sent the teletype message assigning those funds to the London escrow account; at 8:17 a.m. the Central Bank of Algeria, acting as escrow agent, certified to Iran that the money was in place. The United States had done everything it had promised. "We now have every right to expect," Powell said forcefully, "and do expect the expeditious release of our hostages."

But it was not expeditious enough to meet Carter's timetable. According to House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), Carter received a call in the presidential limousine as he and Reagan rode to the inaugural ceremony. The hostage plane would take off within minutes, the message said; then there was another hour's delay.

Back in the White House, Reagan's press staff was moving into Powell's office while Carter's press secretary was still serving as official question-answerer. "Would you say," a reporter asked him, "that Jimmy Carter is free from Washington and the hostages haven't been released?" "That's possible," Powell replied sadly.

By 1 p.m. the new president's staff had passed the word that the hostages were en route home. The ex-president, arriving at Andrews Air Force Base for the flight back to Georgia had nothing to say on the subject. He lingered for handshakes with his staff and a long series of photographs before boarding his plane, and then turned to 2,000 well wishers, waved goodbye and flashed his familiar grin.

He grinned again when he arrived in Plains to the cheers and songs of a big crowd. Now it was his turn to talk about the news that the hostages were free. "I couldn't be happier," the former president said.