UNITED NATIONS, JULY 20 -- The U.N. Security Council today unanimously approved a resolution demanding an end to the seven-year-old war between Iran and Iraq.

The resolution was adopted under a section of the U.N. charter providing for sanctions in case of noncompliance, and it was the first time in the history of the world body that such an action had been taken to seek an end to a war, U.S. officials said.

Secretary of State George P. Shultz said the United States stood ready to support "the decisive application of enforcement measures" upon either warring country if it refuses to heed the U.N. demand for an end to the war.

The resolution "demands" that Iran and Iraq observe an immediate cease-fire, stop all military action "on land, at sea and in the air" and withdraw their forces to their internationally recognized borders. It empowers the U.N. secretary general to send observers to oversee the cease-fire and withdrawal. Imposition of sanctions would require further Security Council action.

Iraq is expected to comply with the resolution, at least initially, but Iranian officials have said that Iran intends to ignore it. Thus, the willingness of the five permanent Security Council members -- the United States, Soviet Union, China, Britain and France -- to agree on and impose any sanctions, such as an arms embargo, remains crucial to whether the resolution will have any effect.

Shultz, who came to the Security Council meeting to underline U.S. support for the resolution, called it a "historic step" and noted that compliance with it was mandatory under the U.N. charter.

U.S. officials said the United Nations previously has passed resolutions demanding an end to states of war, in the Middle East for example, but had not invoked U.N. charter provisions threatening sanctions.

Shultz expressed "grave concerns" about "the policies and practices of the Iranian government outside its borders," mentioning in particular its support of terrorist activities against the United States and American citizens abroad.

At the same time, he said the United States remained "ready and willing" to discuss "the serious problems which continue to divide us."

"A positive Iranian response to this resolution and an end to aggressive actions against other states and their citizens would do much to make possible a mutually beneficial bilateral relationship in the future," Shultz said.

The resolution adopted today was the result of six months of intensive diplomatic efforts led by U.N. Secretary General Javier Perez de Cuellar and the United States. A Shultz aide cited what he called "unprecedented cooperation" among the five permanent Security Council members, who first agreed on a draft and then submitted it to the 10 nonpermanent members.

In an attempt to gain Iranian support for a cease-fire, the drafters included provisions criticizing Iraq, although not by name, and aimed at fulfilling Iranian demands.

For example, the resolution condemned the use of chemical weapons, which Iraq has repeatedly used, calling it a violation of "international humanitarian law."

The resolution also calls upon the secretary general to explore creation of a special body to establish who is responsible for starting the war.

It urged unnamed "other states" to refrain from any act that could widen the Persian Gulf conflict -- an apparent reference to the U.S. build-up of naval forces in the gulf in preparation for the escort of American-flagged Kuwaiti oil tankers.

Nonetheless, most of the statements made by Iranian official during the past few days have suggested Iran will not comply with the cease-fire. Iran boycotted the Security Council session but did not immediately announce its formal rejection of the resolution.

Iranian Ambassador Said Rajaie-Khorassani, leaving the U.N. building after being informed of the resolution by Perez de Cuellar, gave no official reaction, saying he had not yet read the text. "The position of the government is the same," he said, adding that he will hold a press conference here Tuesday.

{Tehran's official news agency quoted President Ali Khamenei as saying before the resolution was adopted that the U.N. effort was "not worth a penny" and threatening retaliation for any attacks on Iranian vessels, The Associated Press reported.}

Soviet Ambassador Alexander M. Belonogov said his country supported "the most effective measures possible" to enforce the resolution.

However, China's representative, Ambassador Huang Jiahua, gave no indication that his country was prepared to propose sanctions. Avoiding use of the resolution's carefully chosen word "demand," he said that the "primary objective" of the resolution from the start was to "encourage" Iran and Iraq to agree to a cease-fire.

Before any discussions of sanctions begins at the Security Council, Perez de Cuellar will go to Iraq and Iran to seek acceptance and implementation of the resolution. He is expected to go next month, U.N. officials said.Special correspondent Michael J. Berlin contributed to this article.