Governments and newspapers throughout the world, with the notable exception of the Soviet Union, expressed relief yesterday at the announced U.S.-Iranian agreement to free the American hostages, and countries that had joined the United States in imposing economic sanctions against Iran prepared to resume normal business.

There was no immediate reaction to Iran's later threat to hold up release of the hostages if a last-minute snag is not resolved.

The freeing of the 52 Americans would also, in the view of many world leaders, allow Iran to end the long political isolation that the detention of foreign diplomats has brought the revolutionary Islamic government.

Although Japan and other U.S. allies in Europe announced plans to resume commerce with Iran, including petroleum shipments, analysts said that the Persian Gulf war and the country's mounting political and economic problems made it unlikely that Iran's international trade would reach significant levels soon.

Britain, West Germany and France, among the strongest public supporters of the United States during the 14 1/2-month ordeal, all expressed their satisfaction at the agreement.

"All countries will be relieved that the violation of one of the most fundamental principles of international law is soon to be at an end," a British Foreign Office spokesman told reporters.

West German Chancellor Helmut Schmidt said, "Our sympathies naturally the whole time were with the hostages." He called the seizure "a blatant violation of international law that set a bad example for the world." French President Valery Giscard d'Estaing, in a telephone conversation with President Carter, expressed his happiness at the agreement, officials in Paris said.

Officials in Tokyo said Japan would move quickly to lift the economic sanctions it imposed against Iran last spring, along with the European Common Market, at the request of the United States.

Until last April, Japan was one of Iran's biggest oil customers, buying more than a half-million barrels a day, but it stopped when Iran raised its prices and shortly after, the sanctions were imposed. Reuter reported yesterday that Japanese business leaders and oil companies said they welcomed the hostages agreement but did not expect trade with Iran, including oil, to expand quickly because of the Iraqi-Iranian war.

The European Common Market imposed its sanctions by consensus rather than by formal joint action so each of the countries can individually resume trade with Iran as soon as practicable after release of the hostages.

Italy, among the countries hardest hit by the suspension of trade with Iran, said yesterday that it was eager to resume and would end its sanctions as soon as possible. Italian Foreign Minister Arnaldo Forlani yesterday praised "the balanced and responsible American policy in the entire affair."

Britian is expected to lift sanctions promptly, but Foreign Office sources told Reuter that normal ties would not be resumed until four Britons being held by Iran are also freed. This would likely block any sales of arms, which Iran would want as replacement for losses suffered during its war with Iraq, the sources told Reuter.

Three British missionaries and a businessman have been held as spies by Iran since August without being charged or put on trial.

Norway announced it would end sanctions and Prime Minister Odvar Nordli complimented President Carter in a telegram for perseverance and moderation in seeking a solution to the crisis.

While China briefly noted the agreement, and said it had been reached "thanks to the efforts by both sides and to the mediation of Algeria," the Soviet Union used the occasion to step up its harsh attacks on past and present U.S. policy on Iran.

Tass, the official Soviet news agency, said that the United States had been "forced" to negotiate with Iran for release of the hostages after the failure of the "provocative commando invasion" by the United States last April and other "blackmail and pressure."

"However all these actions of crude pressure failed to bring Washington the desired result, and in the end the administration of J. Carter was forced to agree to negotiations with Iran," Tass said.

Pravda continued the bitter Soviet attack, declaring in a commentary, that the United States had dealt dishonestly with Tehran, "which serves as a typical example of imperialism's policy of the stick and the carrot," Washington Post correspondent Kevin Klose reported from Moscow. Pravda accused Washington of mixing "alluring promises" with "crude threats."

The Kremlin's hostility toward the United States on the issue of the hostages was a carefully formulated policy intended to be part of its campaign to soften the anti-Soviet views of Iran's ruler, Ayatollah Ruhollah Khomeini, Kose reported.

Soviet propaganda, beamed into Iran from powerful transmitters near the border, repeatedly described the hostage U.S. diplomats as spies and insisted that Washington was using the hostages as a pretext to prepare an invasion.

Other cautionary responses to the agreement came from parts of the Arab world.

Iraqi President Saddam Hussein, in a Kuwaiti newspaper interview said, according to The Associated Press, "The United States has been dropping hints that it is prepared to make Iraq pay the price of the new relationship between Washington and Tehran . . . Iraq will accept a settlement of the problem at our expense."

Al Ittihad, a newspaper in Abu Dhabi, asked in an editorial, "What will be Washington's new stand toward the [Persian] Gulf area, its oil wealth and international designs toward it?"

But Egyptian officials welcomed the agreement and Habib Chatti, secretary general of the Islamic Conference Organization, speaking in Taif, Saudi Arabia, said, "We are very relieved to hear of the end of the crisis, which I believe was hindering Iran's progress in all fields."

Farouk Kaddoumi, head of the political department of the Palestine Liberation Organization, said release of the hostages would "serve peace in the region" and would also "reflect positively on the war between Iran and Iraq," United Press International reported.

Israeli Prime Minister Menachem Begin sent Carter a message "to a express my joy over this wonderful news."