U.S. officials early this morning announced agreement with Iran on terms to permit the release of the 52 American hostages held captive in Tehran for 444 days.

White House press secretary Jody Powell said Treasury Secretary G. William Miller was informed by telephone at 3:16 a.m. that the Iranians had agreed to a rewritten version of a document to which they had objected yesterday, spelling out how billions in frozen Iranian bank deposits and other assets are to be returned to that country.

Powell said Miller immediately instructed U.S. banks to transfer about $4 billion in Iranian funds to the Federal Reserve, the first step in the movement of the money into an escrow account in the Bank of England.

Iran would have to be assured the money had been moved, Powell said, "then the next step is release of the hostages."

But Powell said he did not know long the remaining formalities might take, nor when the hostages might actually be freed. Nor was there any immediate confirmation from Tehran that a deal had been struck; Iranian officials there were reported still meeting with the Algerians who have been intermediaries in the hostage negotiations.

It was the second time in 24 hours that officials had announced an agreement to free the hostages -- and the second night in a row in which the departing president had stayed up in the Oval Office, seeking to solve the problem that many experts believe caused his defeat at the polls last November. He turns over the government to his successor, Ronald Reagan, at noon today.

Powell's announcement came after a possibly final day of anguish on the hostage issue, as Iranian officials balked at the last few provisions of the complicated agreement to free the captives. That unexpected development had crushed Carter's hope that he could greet the hostages when they arrived at a U.S. military hospital in West Germany his last night in the presidency.

It left the hostages in a new sort of limbo -- imprisoned somewhere in Iran for the 444th day since an armed Iranian mob seized the American embassy in Tehran with the complicity of the Iranian government. And it left their families back home in America with a renewed sense of anguish and fear.

On Sunday, Iran had announced that an agreement for the prompt release of the hostages had been reached. Indeed, the chief Iranian negotiator boasted that "we have managed to rub the nose of the world's biggest superpower in the dust."

At 4:58 a.m. yesterday, President Carter announced that "we have now reached an agreement with Iran which will result, I believe, in the freedom of our American hostages. The last documents have now been signed in Algiers, following the signing of the documents in Iran which will result in this agreement."

The president even drank a champagne toast to mark the end of one of the most frustrating and humiliating episodes in American history. It was the episode that some believe wrecked Carter's career and led to the election of Ronald Reagan, who becomes president at noon today.

The president's pre-dawn statement created a sense of euphoria among the hostage families and among ordinary citizens as well. New York planned a ticker-tape parade. Congratulatory messages poured in from world leaders and politicians of both parties on Capitol Hill.

Iran seemed to want an end to the affair, too. Several explanations were offered, including financial and economic distress in the country, isolation from much of the world and Reagan's imminent takeover of the White House. As the chief Iranian negotiator put it: "We had no interest in continuing negotiation with someone who called the Iranians barbarians."

Reagan used that term last week. Moreover, his incoming defense secretary, Caspar Weinberger, said yesterday the new administration should establish a policy that would make it clear that there would be very "severe ultimate reprisals by the United States should anything of this kind happen [again]."

In any case, Algerian doctors were brought in to examine the hostages. They pronounced them in good health. Two Algerian 727s arrived at Mehrabad Airport in Tehran, stocked with fruit and sandwiches. They were prepared to fly the hostages to Algiers, where they would be transferred to Air Force hospital planes for the flight to Wiesbaden, West Germany.

But, as the day wore on and the airplanes did not take off from Tehran, it became obvious that some hitch had developed. Carter canceled his flight to Germany. President-elect Reagan then asked Carter to welcome the hostages whenever they arrive in Wiesbaden. Carter agreed.

For the hostages families, another cruel ride on the emotional roller coaster began. From jubilation at dawn, the mood shifted quickly. Euphoria gave way to apprehension. By day's end, Harry Metrinko, whose son, Michael, is a hostage, said he was "just struggling along."

David Engleman, brother of a hostage, said, "I'm running on expectancy now . . . I don't feel too drawn out.I'm sure when we get the word the hostages are on the plane and out of Iran I'll be able to breathe easier."

That could happen today, depending on the seriousness of the complications that arose yesterday in Tehran.

But as the night yielded to the new day, Iran said it would give U.S. banks a deadline for the transfer of frozen Iranian funds in exchange for the hostages or, it warned ominously, "more sever decisions will definitely be made."

The weekend agreements involved a pledge by the United States to never again intervene, politically or militarly, in Iran's internal affairs and a further pledge to release about $8 billion in frozen Iranian assets as soon as the hostages were airlifted out of Iran.

The snag that developed involved an 11-page appendix to the weekend agreements, a document delivered to the Iranians yesterday. The official Iranian news agency, Pars, said the appendix would "make it binding on Iran to drop any further claims beyond the approximately $8 billion which are to be escrowed in the British central bank [the Bank of England]." The agency quoted the Iranian minister of state, Behzad Nabavi, as saying that the appendix had no place in the agreement and that it represented "an underhanded maneuver for delaying the final solution of the problem."

Iran he said, "severely condemned this subterfuge by the U.S. banks and wishies to open the minds of the world people and especially the minds of the American public to this fact."

He also said, however, that negotiations were continuing in Algiers between the U.S. and Algerian mediators who, he said, "fully supported Iran's stand on the issue."

Another explanation for the failure to release the hostages was given in a Tehran radio commentary which claimed that the Americans were being held to deprive Carter of the opportunity to greet them as his last official act before Reagan's inauguration.

"I can't tell you if it's deliberate," said Carter's press secretary, Jody Powell. "It was hard to tell what was deliberate and what was not with them all along." Powell said that if the agreement is not completed in every respect by noon today, Reagan will not be bound by it. The new president, he said, will be free to act as he chooses.

Earlier yesterday, the political community in Washington was generous in its praise of Carter's efforts. "The nation owes him its collective tahnks," said Rep. Clement J. Zablocki (D-Wis.), chairman of the House Foreign Affairs Committee.

Sen. Paul Laxalt, a Nevada Republican and one of Reagan's closest allies, said Carter had achieved a "beautiful result." Republican Sen. Charles Percy of Illinois, chairman of the Foreign Relations Committee, said, "I think it would have been a tragedy if he had left office without it being resolved -- a personal tragedy and a national tragedy. . . . It would have been the single greatest symbol of American failure. Having resolved it, we're all gratified."

Reagan himself blessed Carter's efforts yesterday morning but said he still had his fingers crossed in anticipation of the final outcome.

Senate Majority Leader Howard H. Baker Jr. of Tennessee called yesterday for a thorough review of the incident, to help develop U.S. policies to protect the nation's diplomats and prevent a recurrence of the crisis. But, he said, "I do not forsee or wish to see" an inquiry into the seizure of the hostages in Iran.

It was two hours before sunrise in Washington when a somber and weary president announced the agreement for the hostages' release.

Carter said the agreement with the Iranians provided that "following the release of our hostages . . . we will unfreeze and transfer to the Iranians a major part of the assets [about $6 billion] which were frozen by me when the Iranians seized our embassy compound and took our hostages. We have also reached complete agreement on the arbitration procedures between ourselves and Iran, with the help of the Algerians, which will resolve the claims that exist between residents of our nation and Iran, and vice versa."

These claims will be decided by an International Arbital Tirubnal. It will consist of at least nine members -- three selected by the United States, three by Iran and the remaining three jointly by the two countries.

The prolonges and tedious negotiations had their beginning on Nov. 2 when the Iranian parliament laid down four conditions for a settlement. Carter replied that the conditions appeared to offer a "positive basis" for an agreement. Weeks of haggling followed with the government of Algeria acting as a mediator and go-between.

At one point the Iranians demanded payment of $24 billion but this was scaled down to the figure finally agreed upon yesterday. The chief American negotiator, Deputy Sceretary of State Warren Christopher, put his initials on the agreement at about 3:15 a.m. in Algiers. "At last I can smile," he said.

Under the terms of the agreement the money involved in the settlement was to be transferred by the United States to the Bank of England shortly after the hostages left Theran.

The Carter administration emphasized that no ransom was being paid to Iran. As Vice President Mondale put it, "not a dime of American money" was involved. The entire sum came from Iranian assets that Carter had impounded after the hostages were taken.

He and Christopher expressed gratitude to the Algerians for their role in the settlement. "The American people," said Christopher, "will always remember this contribution to humanitarian matters by the Algerian people and their leaders."

The Algerian assistance was not confined to the negotiating process. An Algerian medical team flew to Tehran last week and examined all of the hostages before they were set to depart on Algerian aircraft.

The flight from Tehran to Algiers would take eight hours, including a refueling stop in Ankara, Turkey. In Algiers, the hostages were to be transferred to DC9 Nightingales, the hospital aircraft used by the U.S. Air Force.

Their reunions with their families would be delayed for perhaps a week if State Department recommendations are followed. Psychiatrists have taken the view that an immediate reunion would be unwise, that the hostages need time to "decompress" and reorient themselves after their long ordeal.

The younest of them is a 20-year-old Marine, Kevin Hermening of Cudahy, Wis. The oldest is Robert Ode, 64, of Sun City West, Ariz. All but two of the hostages are in government service, either as diplomatic employes or as military personnel.

When the embassy was overrun 14 1/2 months ago, nearly 100 hostages were seized, including foreign citizens working at the American embassy. Within a few days, however, the Iranians released most of the women and black hostages. Later, six other Americans were smuggled out of the country by Candian diplomatic personnel. Still later another hostage -- Richard Queen -- was released after becoming serously ill.

For the 52 who reminded, there were days of despair. Their own government seemed impotent. Negotiationg proposals repeatedly were rejected by the Iranians. A clandestine military rescue attempt ended in disaster and the loss of eight American lives last April. United Nations resolutions and rulings by internationals courts were ignored by Iran.

The political chaos inside that country further complicated the situation. It has never been clear who is in control of the Iranian government or who was capable of speaking in its behalf.

In the United States, these events have created shifting emotions and attitudes. The initial reaction to the hostage-taking was anger. There were cries for revenge, including military action. In some cities Iranian nationals were physically assaulted. Popular songs were written, expressing the national sense of outrage.

Other emotions were at work, too. Some Americans have expressed guilt at past U.S. policies in Iran, especially those policies of support of the late Shah Mohammad Reza Pahlavi, who was overthrown in January 1979. They expressed sympathy for the Iranian revolution and called for understanding and patience, rather than retaliation.

That was the course Carter followed for five months. Then, frustrated and despairing of a negotiated settlement, he ordered a rescue effort by a small force of American troops. They landed secretly in an Iranian desert but soon aborted their mission because of aircraft failures and a disastrous accident that claimed the lieves of eight men.

The political impact of all this on Carter's fortunes was mixed. Initially, the public rallied to his support and the crisis undoubtedly contributed to his renomination. But his failure to secure the hostages' release just before the election was, in the opinion of his own political advisers, a major factor in his loss of the presidency.

The long-term effect of the Iranian episode is yet to be seen, but it already has contributed to a more militant American foreign policy posture and to a growing willingness in the country to greatly increase military spending.

For the hostage families, the ultimate effect of this experience on their lives is also to be seen. But their immediate reactions to the presumed settlement were predictable.

Dorothea Morefield, wife of one of the captives, wept. "It's over, It's over. It's finally over," she said.

Elisa Moeller, wife of Marine Staff Sgt. Michael Moeller, said, "I really think they're going to be fine. People that were strong when they went in are going to be strong when they come out. On the Christmas tapes, Michael was still his cynical little self . . . . He's still got his dry sense of humor."

Louisa Kennedy, a prominent figure among the relatives of the hostages, said her "greatest consideration at the moment is what I will say to my husband. I have made up several dialogues in my head overnight. And I sincerely doubt that any of them will be the one that takes place . . . . It's going to be such an emotional moment. I hope he'll find the words first because I may not be able to."