Saudi Arabia and Iran are set to sign a security agreement Tuesday that signals declining concern by the Arab countries of the Persian Gulf that Iran is trying to undermine them.

The countries' interior ministers finished negotiating the pact today in Tehran. It will commit the countries to cooperate on issues as varied as money-laundering and fighting terrorism.

In past years, the gulf monarchies suspected Iran of supporting Shiite dissident groups in the area. Distrust was so deep that Saudi Arabia helped underwrite Iraq's eight-year war against Iran in 1980.

Worries about Iran have decreased steadily since Iraq emerged as a Saudi foe in the 1991 Persian Gulf War and the moderate Mohammad Khatami was elected president of Iran in 1997. His visit here two years ago helped build trust between his country and its gulf neighbors.

Officials here said the pact shows the two nations are ready to cooperate on regional stability. The agreement "is the most important development in the history of relations between the two countries," Ali Asghar Khaaji, Iran's ambassador to Saudi Arabia, told reporters in Tehran.

The U.S. government still considers Iran a sponsor of terrorism and suspects it of involvement in the 1996 bombing of an apartment building in eastern Saudi Arabia that killed 19 U.S. servicemen. Saudi investigators have refused to confirm or dispel that suspicion, to the frustration of officials in Washington.

Like Iran, Saudi Arabia entwines religious principles and Islamic law with its politics. But after Iran's Islamic revolution in 1979, the Saudi government was unnerved by the dominance of Shiite Muslims in Iran and suspected Tehran was trying to influence Saudi Arabia's Shiite minority and undermine the Saudi ruling family.

Most Saudis follow a branch of Sunni Islam that considers some Shiite practices to be violations of the faith.

Diplomatic ties between the nations were severed for four years after 1987 clashes between Saudi security forces and Iranian pilgrims in Mecca left more than 400 dead. The Iranians were staging protests against Saudi Arabia and the United States.

Today the two countries still have major disagreements, notably on the role of the United States in the region; Saudi Arabia hosts about 5,000 U.S. troops on its soil. But in recent years, Saudi leaders have come to view Iraq as the more urgent threat.