Agreement between Iran and the United States would culminate more than a year of captivity for 52 Americans and follow four months of intermittent, indirect, but intensifying negotiations in which the Iranians have found it much harder to free the hostages than it was to seize them.

The Iranian leadership, having gradually concluded sometime last fall that holding the hostages had become more trouble than it was worth, found that unraveling punitive measures imposed by the United States was so complex that it could well take longer than the hostages' time in captivity.

During that period of negotiations, Iran repeatedly ran up against crucial dates -- deadlines real or imagined -- that it tried to manipulate to its best advantage. In the end, however, it came down to trying to get the best possible deal from a familiar adversary or facing the prospect of returning to square one. Underlying that was Tehran's urgent need for money and an end to the Western embargo that has denied Iran goods and material needed to carry on a debilitating war with neighboring Iraq.

The chain of events leading to agreement between Tehran and Washington began Sept. 12 when Ayatollah Ruhollah Khomeini listed four terms for the Americans' freedom -- release of Iranian assets, cancellation of U.S. claims against Iran, return of the late shah's property and a promise not to interfere in Iranian affairs. oKhomeini announced the conditions almost in passing in a speech to Moslems setting off for the hajj, the annual pilgrimage to Mecca.

Given Khomeini's past statements, including a demand for a U.S. apology for "crimes" in Iran, the four conditions were regarded as a softening of his position. Later, however, various Iranian officals said that Khoemini merely "forgot" to include the demand for an apology and that his conditions were subject to interpretation and amendment.

According to news reports from Tehran, the United States responded quickly to Khomeini's conditions in a letter sent through diplomatic channels to President Abol Hassan Bani-Sadr. The letter reportedly set out the U.S. position on the terms and explained what Washington could do to meet them. The sticking point for Washington was said to be the return of the shah's wealth.

On Oct. 2, after a series of parliamentary sessions that included discussion of the hostage issue, the assembly set up a seven-member commission to recommend conditions for the release. There were conflicting reports about what the commission would conclude, with some legislators insisting that demands for a U.S. apology and other concessions would be added, while others said the panel would stick to Khomeini's suggestions.

Complicating the deliberations was the outbreak of the war between Iran and Iran on Sept. 22. The two countries' warplanes raided each other's capitals, and Iraqi ground forces invaded the southwestern Iranian oil-producing province of Khuzestan. Despite its declaration of neutrality, the United States was caught in the middle as each side accused Washington of backing the other.

Nevertheless, the war eventually proved to be a key factor in Iran's eventual decision to seek a solution to the hostage issue. It increased the urgency of Iran's need for money and the ability to buy goods freely -- especially military equipment -- on the world market without recourse to expensive and complicated dealings with middlemen and various sanctions-breakers.

It was many weeks, however, before that urgency became acute, and there were many dashed hopes for a hostage release in the meantime. For example, speculation that a resolution of the hostage issue was in the offing surfaced again when Iranian Prime Minister Mohammad Ali Rajai made an unexpected trip to the United Nations in New York on Oct. 17.

President Carter and Secretary of State Edmund Muskie offered to meet Rajai, but the Iranian premier spurned all overtures on the hostage issue. Instead, in a speech before the Security Council, he accused the United States of helping Iraq in the Persian Gulf war in an effort to force the captive Americans' release.

U.S. officials took some heart, however, from Rajai's statements the next day that he believed Washington already had apologized, in effect, for its support of the shah and that Iran would solve the hostage issue soon.

Eight days later, the Iranian parliament began a public session to hear the special commission's report on terms for release and debate them. But the session was thrown into an uproar by news of an Iraqi missile attack on the southwestern city of Dezful that morning, and the legislators voted to discuss the hostage issue behind closed doors.

A motion to put off all discussion of the matter until the end of the war with Iraq was narrowly defeated as hard-liners, opposed to the hostages' release, joined forces.

After three days of inconclusive secret debate, the parliament voted to hold another public session on the conditions for release, but the hard-liners succeeded in preventing a quorum by boycotting the meeting.

That action drew an angry response from key Iranian clergy, who urged the deputies to take action quickly to resolve the hostage issue.

Matters began to move again on Nov. 2 when the parliament approved an embellished version of Khomeini's four conditions. To the dismay of American officials, however, the conditions were set forth not as general principles but as requirements, in profuse, legalistic detail.

The timing, two days before the U.S. presidential election, suggested Iranian politicians believed Carter would have no choice but to comply.

The United States agreed in principle. But U.S. officials said from the first that, if taken literally, the Iranian conditions would be difficult or impossible to meet. Instead, the United States decided to propose alternate ways, within American legal and political constraints, of meeting the general objectives of the demands.

According to documents released in late December, after the Iranians made the details public, the United States agreed at the time to the immediate transfer of $2.5 billion in blocked Iranian funds in the Federal Reserve Bank, binding arbitration of legal claims against Iran and a freeze on assets in the United States of the late shah and his family.

As part of the proposed settlement, the United States also agreed to stop any American claims against Iran arising from the hostage seizure and to withdraw all U.S. claims pending against Iran in the International Court of Justice in The Hague.

After considering the Iranian conditions, a U.S. team flew to Algiers with the five-page, double-spaced reply, which Algerian intermediaries took to Tehran Nov. 12. Two weeks later, Iran posed nine questions that the Algerians brought to Washington Nov. 26. The U.S. answers were taken to Algeria Dec. 2 by an American team headed by Deputy Secretary of State Warren Christopher for transmission to Iran.

In that proposal, the United States reworked the description of its basic positions, with only a few modifications. rTwo new U.S. documents, described as "answers" to Iran and "comments" on those answers, related each of the American proposals to a specific requirement of the Iranian parliament.

The answers were stated in flat terms thought likely to win approval in Tehran, although they were modified by the accompanying "comments."

Iranian authorities mulled the proposal, then threw a wrench into the negotiations on Dec. 19 by demanding that financial guarantees totaling $24 billion be deposited by Algeria before the hostages could be freed. The demand appeared to reflect an Iranian attempt to manipulate another deadline of sorts, Christmas, when American hopes for a holiday release were reaching another peak.

Of the deposit, the Iranians explained, $14 billion would be a "guarantee" that Iranian assets in the United States would be returned. The remaining $10 billion represented a "guarantee" that Washington would return to Iran to wealth in the United States of the late such and his close relatives. Muskie said the $24 billion figure was "unreasonable," and President Carter said Washington could not pay "ransom." The Iranian estimate of $10 billion for the Iranian royal family's U.S. asets was regarded as particularly outlandish.

According to an Iranian official, the new proposal, which Tehran said was "final," also accepted the concept of arbitration of the Iranian claims.

The Dec. 19 Iranian demand dampened hopes -- originally raised by positive statements from Iran -- that the hostages would be home for Christmas. Instead, Iranian authorities allowed three Christian Iranian clergymen and the papal nuncio in Iran to visit the hostages on Christmas Day at a secret location in the Tehran area.

The next day, two of the algerian intermediaries were also allowed to see all the hostages and reported finding them in "good health."

After four days of talks with the Algerian intermediaries during the last week of December, the United States rejected the Iranian plan and formulated a counterproposal calling for placement of steadily increasing sums of Iranian assets in an "intermediate" position -- outside the full control of the united states but not yet in the hands of Iran -- as a prelude to a release.

According to Washington sources, the proposal included the return to Iran of $4.5 billion of its more than $8 billion in frozen assets plus another 1.6 million ounces of gold.

The Iranians brought that proposal to Algeirs Jan. 3. At the same time, the Carter administration told Iran that it had until Jan. 16 to accept the proposal.

U.S. officials said the date was not an ultimatum but "simply a fact of life." They explained that unless Iran accepted the plan by that date, there would not be time for the outgoing administration to implement the complex provisions on Iran's financial assets before Jan. 20 inauguration of President-elect Ronald Reagan.

On Jan. 2, Tehran radio said it seemed "completely unlikely" that the hostages could be released before Inauguration Day, and it warned Reagan that Iran was not prepared to make any concessions.

The Iranians baffled the Americans when they announced later in the week that three hostages who had been held in Iranian Foreign Ministry throughout the ordeal had been moved to a secret location where some of the other hostages were being kept. The move set off speculation that some sort of release was imminent, but the Iranians denied the rumor.

Iran relayed a new set of questions about the American proposal on Jan. 6 through the Algerian intermediaries. In Tehran, Prime Minister Rajai said that Khomeini, the ultimate decision maker in Iran, had authorized the government to accept unspecified guarantees by Algeria "to solve our problem with the United States."

Deputy Secretary of State Christopher flew to Algiers the next day to continue the negotiations, apparently because the Algerians raised some technical questions about the U.S. proposal.

In the United States, however, Reagan told reporters he would not provide a "blank check" for the Carter administration's diplomatic efforts and called the captors in Iran "barbarians."

Thus, in an effort to complete the negotiations before the inauguration, Christopher's team remained in Algiers beyond its scheduled two-day visit, and the negotiations intensified.

Washington sources reported that the Carter administration was trying to draft a legally binding, international agreement that would set terms of the settlement and would be signed by either Iran or Algeria on Iran's behalf. The sources added that the administration hoped to assure the Iranians that the agreement would be binding on Reagan.

Last Monday, Iranian Executive Affairs Minister Behzad Nabavi, in charge of Tehran's end of the negotiations, presented two bills to the parliament concerning the hastage talks.

The first, about financial and legal problems between the two governments, was passed the following day. It gave the government parliamentary authorization claims by arbitration, a major compromise allowing a final agreement to be signed.

The parliament referred to second bill, on nationalizing the shah's wealth, to a committee, Iranian sources said it was not considered important for resolving the hostage issue.