MANAMA, BAHRAIN, AUG. 15 -- Bitter enemies Iraq and Iran appeared on the verge of a peace agreement today after Iraqi President Saddam Hussein offered to withdraw troops from Iranian territory, a move that would free thousands of Iraqi troops to face a U.S.-led force gathering in the Persian Gulf.

Saddam's unexpected offer included a near-total acceptance of Iran's peace terms after an eight-year war started by Iraq that took more than a million lives. In an announcement on Baghdad radio, Iraq said it would recognize Iran's disputed pre-war borders, release all war prisoners and begin withdrawing troops from about 1,000 square miles of occupied southwestern Iran as early as Friday.

An Iraqi delegation arrived in Tehran late today carrying a letter in which Saddam reportedly told Iranian President Ali Akbar Hashemi Rafsanjani: "Everything you wanted . . . has been realized."

Iranian Foreign Minister Ali Akbar Velayati triumphantly told Tehran radio, "This is the biggest victory of the Islamic Republic of Iran throughout its history." An Iranian spokesman said the government would review Iraq's proposal "with optimism," and he predicted it would lead to a "lasting and just peace."

Saddam's offer appears virtually certain to ease military pressures along Iraq's eastern border at a time when Iraqi troops are digging in near Saudi Arabia and reinforcing the country's northwestern frontier with Turkey.

Peace with Iran could also help Saddam circumvent sweeping U.N. economic sanctions imposed on Iraq after its Aug. 2 invasion of Kuwait if Iran opened its border, more than 700 miles long, to trade with Iraq. The border has been sealed by their military standoff.

In addition, improved relations between Iran and Iraq are likely to bolster their cooperation within the Organization of Petroleum Exporting Countries, where the longtime foes have joined to press for higher oil prices. If the sharp rise in oil prices that has followed Iraq's invasion of Kuwait is sustained for months through joint Iraqi and Iranian pressure, it could provide incentive to oil-importing nations to ease or skirt sanctions against Iraq, according to bankers and oil traders.

White House Press Secretary Marlin Fitzwater dismissed Saddam's offer to Iran, Washington Post staff writer Dan Balz reported from Kennebunkport, Maine. "It doesn't deal with Kuwait. It doesn't deal with the invasion. It doesn't deal with any of the objectives that we have," he said, describing it as "another diversion."

U.N. Secretary General Javier Perez de Cuellar, however, welcomed Saddam's letter and said that while it was still "being carefully studied, it appears that this letter represents a major new development" in U.N. peace efforts.

But Arab officials and diplomats were divided today about whether Saddam's abrupt move represented a stroke of pragmatic cunning or an act of desperation in the face of international pressure that could weaken the Iraqi leader at home and in the Arab world.

In Cairo, Egyptian officials reacted to Saddam's peace offer with a mixture of surprise and suspicion, suggesting that it was motivated solely by a need to remove the threat of a second front on his eastern border while he directs the attention of his army toward the multinational force buildup in the Arabian Peninsula.

While there was no official reaction from the Egyptian government, a senior official close to President Hosni Mubarak said Saddam may have aspirations of enlisting Iran's help in circumventing the international trade blockade. "If Iran joined with Saddam Hussein, the blockade would not be as effective," the official said.

Tahseen Bashir, an Egyptian diplomat and commentator who is regarded as an unofficial spokesman for the government, expressed astonishment at Saddam's sudden turnabout after the eight-year war, saying: "After $150 billion wasted and hundreds of thousands of lives lost, he returns to his exact starting point. Someone has to account for what he has done."

Iran's official news agency reported that Syrian Vice President Abdul Halim Khaddam and Foreign Minister Farouk Charaa also arrived in Tehran today for talks with Iranian leaders. Syria was Iran's main Arab supporter during the Iran-Iraq war and is still hostile to Iraq.

While announcing his peace offer to an Iraqi population still reeling from the social and economic consequences of the long war with Iran, Saddam tried to make the best of his apparent capitulation by blaming the West for his predicament, saying the withdrawal from Iran was necessary to "confront evildoers" who had come to the Persian Gulf region to desecrate Islam.

That tone seemed calculated to appeal both to domestic opponents who might wonder if Saddam's zeal to battle Iran during the 1980s had led to nothing and to an Arab world that appears increasingly uncomfortable with the massive buildup of Western armed forces in the region.

Iraqi troops invaded Iran in 1980 after Saddam declared that he wanted full sovereignty over the strategic Shatt al Arab waterway, which provides access to the Persian Gulf. Baghdad radio said today that Iraq is now prepared to give Iran back its half of the Shatt, which would be of less value to Iraq if Saddam can retain his grip on Kuwait and its gulf ports.

Iraq's apparent willingness to withdraw from Iran's part of the Shatt and to recognize a 1975 accord dividing the waterway -- an accord Saddam publicly tore to pieces several days before invading Iran -- would appear to clear the way for a formal peace treaty between the two countries. Iraq also said it would release an estimated 30,000 Iranian war prisoners, some of whom have been held for a decade.

Iraq and Iran agreed to a U.N. cease-fire in 1988, but hundreds of thousands of troops from each side have remained face-to-face in tense readiness since then because the countries were unable to agree to permanent peace terms.

For the West, the principal challenge of Iraq's peace initiative would appear to lie in whether Iran will become a major hole in the wall of economic isolation erected around Iraq since its invasion of Kuwait.

Diplomats and other sources in Tehran said it was not clear whether, in exchange for a peace agreement, Iran had privately agreed to help Saddam circumvent U.N. economic sanctions. Iraq's announcement referred vaguely to Baghdad's hope that it would obtain "other cooperation" after making peace with Iran.

Iran swiftly condemned the invasion of Kuwait but has taken no public stand on sanctions. Last week, Iran denounced the deployment of U.S. and other Western armed forces to defend Saudi Arabia, another of Iran's bitter rivals in the region.

Recent statements by officials and commentaries by newspapers linked to factions in the Iranian government have signaled disagreement over whether Iraq or the Western military presence is the greater threat.

Some diplomats in Tehran said Iran was in no position to help Iraq with food or other basic supplies banned under the U.N. sanctions. Iran's annual net import bill for food runs between $3 billion and $4 billion, including large amounts of wheat and other staples sold by such Western countries as Canada and Australia.

Moreover, Iran's basic economic infrastructure is a shambles after the war with Iraq. Its ports have been damaged by Iraqi bombing raids and missile attacks, its roads need rebuilding, and there is a country-wide shortage of commercial trucks and other transport equipment. The country's working ports all lie on the Persian Gulf, where U.S. and Western warships have arrived to enforce the U.N. sanctions.

Still, if Iran quietly opened its long land border to traders wishing to move supplies to Iraq, or if it opposed Western efforts to impose a blockade by force, it might give a significant lift to Saddam's attempt to outlast international sanctions.

There also was no sign from Iran of whether it would continue to demand Iraqi reparations for war damage, estimated at about $100 billion.

Rafsanjani faces competing domestic pressures as he evaluates Saddam's peace initiative and its implications amid the rising tensions in the gulf. Iranian diplomats said they would be shocked if Rafsanjani spurned the offer as long as Saddam is prepared to follow through on today's pledges. Weary after years of war, ordinary Iranians across the political spectrum have been pressing for economic progress and the return of war prisoners.

Saddam's peace terms represent a gift-wrapped political victory for Rafsanjani, Iranians said. While basking in the glow of victory, however, Rafsanjani has other concerns. He has staked his political identity to a five-year economic recovery plan that calls for a projected $27 billion in credits from the West and has built momentum for that plan in recent months. He opened his country to Western aid after a devastating earthquake in June isolated his radical opponents in parliament and recently restoring diplomatic ties with Britain, which were severed during the Salman Rushdie affair.

Iranians and diplomats said they did not think Rafsanjani could afford to reverse course on his economic program by alienating his potential financial backers abroad, particularly in Europe and Japan, through subversion of economic sanctions against Iraq.

"If Iran can have its cake and eat it too, it will do so," one diplomat said. "You can have a peace treaty with Iraq and still not necessarily violate the U.N. sanctions."

Nonetheless, the warm words exchanged between Baghdad and Tehran today reflect common interests -- both economic and ideological -- that could shape the outcome of the volatile Persian Gulf crisis, Arabs, Iranians and diplomatic sources said.

Economically, Iraq and Iran both desperately need hard currency to rebuild their war-shattered facilities, and the easiest way for both to earn cash is through oil sales at the highest possible prices.

Even before today's public rapprochement, the rivals had joined their powerful voices within OPEC to boost oil prices by intimidating such producers as Saudi Arabia and the United Arab Emirates, which enjoy large oil surpluses and generally seek lower prices in an effort to stoke demand in the West.

That program of joint intimidation by Iran and Iraq is certain to continue, bankers and oil traders said today, and if it succeeds it may have greater impact on Saddam's position than any smuggling program across the Iranian border. "If the price of oil goes through the roof, there is going to be much more incentive around the world to break the sanctions," said a European oil financier. "Obviously Saddam's going to be appealing to the Iranians to help him, and the Iranians have their own incentives."

Although sharply divided on matters of religion and politics, Iran and Iraq also share a strong rhetorical antipathy to the West, particularly the United States. As tens of thousands of U.S. troops pour into Saudi Arabia -- a common Arab foe of Baghdad and Tehran -- leaders in both countries seem likely to step up their public denunciations of American aims and actions in the Middle East.

Special correspondent Sharif Imam-Jomeh reported from Tehran:

Residents of the Iranian capital welcomed Iraq's concessions, expressing relief at a reduced prospect of renewed fighting with Iraq and an early return of thousands of prisoners of war. A Foreign Ministry spokesman said the Red Cross had told the government to expect the release of 2,000 Iranian prisoners on Friday.

Unlike the day two years ago when the cease-fire ended eight years of grinding warfare, there was no din of car horns, no flashing of headlights, no dancing in Tehran's streets. Joy at the announcement was mixed with skepticism.

"If this goes well, it will lower the tensions in our society," said a young artist.

"Last week, the only thing that I expected to come to us from Saddam was harm," said a shop owner in downtown Tehran. "Yes, now I am very much relieved to see the issue of war resolved."

The most emotional response here came from the families of Iran's thousands of POWs. The family of Aref Sajadechi, a 28-year-old Revolutionary Guardsman who has been held prisoner since 1982, wept as relatives and friends stopped to offer congratulations. "I really cannot express how happy I am at the news of the release of my son and thousands of other prisoners," his father said.

Correspondent William Claiborne in Cairo and special correspondent Trevor Rowe at the United Nations contributed to this article.

Jurisdiction over the Shatt al Arab, Iraq's only outlet to the sea, has complicated Iranian-Iraqi relations for decades. Iraq controlled the waterway for most of the century, but relinquished half the channel after negotiations with the Shah's government in the mid-1970s.

Though the Persian Gulf War ended in 1988, the Shatt remains largely closed to shipping due to silt and rusting vessels blocking the waterway.

1975: The Algiers Accord set the Iran-Iraq border in the middle of the waterway's main channel.

1980: Saddam Hussein abrogated the accord and revived Iraq's claim that the border ran down the Shatt's eastern bank.

Wednesday: Saddam offered to accept the terms of the Algiers Accord, setting the border back to its 1975 location.