One surprise of the war is the success of anti-terrorism measures taken by the United States and its allies.

But there are no grounds for complacency today.For several months before the outbreak of the war, Israel had been monitoring a major Iraqi effort to prepare for an extensive terrorist campaign against Western targets.

With the war over, there is danger that the Iraqi debacle will trigger terrorism.

After Israel's 1967 and 1973 victories there was an upsurge in terrorism aimed partly at accomplishing what the wars had failed to do.

Terrorism can thwart peace efforts through, among other things, attacks on civilian targets at crucial moments and the assassination of political and military leaders.

From Jan. 16, 1991, to March 16, 1991, only 172 terrorist attacks, mostly bombings against Western targets, occurred - bad enough but far fewer than expected.

Most attacks were directed at American targets (cultural facilities, banks) in Arab and Third World countries (Lebanon, Brazil, Chile, Peru, India, the Philippines).

While the United States and other Western countries took exceptional defensive and offensive countermeasures to protect themselves, comparable precautions in Third World countries were only halfhearted.

The defensive measures included strict security at public activities and sites and extensive examination and investigation procedures at airports and other transport facilities.

Offensively, law-enforcement agencies investigated and restricted the movements of Arab nationals.

Most Iraqi diplomatic delegations, which had repeatedly abused their diplomatic status to support terrorist operations, were drastically limited and their remaining personnel put under surveillance.

Outside the Mideast not all terrorist groups operate under state sponsorship.

But in the region every group engaged in international terrorism has been sponsored by at least one Arab state.

Iraq and Syria have used terrorism against each other and other regimes. Libya and Iran still sponsor terrorist groups. Jordan is host to the Palestinian Islamic Jihad, which has repeatedly threatened to attack American targets.

The best way to reduce Mideast terrorism is to stop the state support on which it depends, as has been proven with Syria.

The West should expand measures taken against Iraqi diplomatic delegations during the war.

These measures should be complemented by similar steps against the potential abuse of diplomatic immunity by countries that continue to support Iraq and those known to be longstanding supporters of terrorism.

America's economic interests around the world were warned last week at a conference of the American Society for Industrial Security in Washington not to relax their defenses anywhere.

In view of this message, until there is a technological breakthrough in detecting explosives, America's Federal Aviation Administration would do well to reconsider its relaxation of airport security measures to permit curbside check-ins.

(Yigal Carmon is Prime Minister Yitzhak Shamir's adviser on countering terrorism.)