Every evening during the celebrations, the Arabian Gulf highway was filled with honking cars. Black-veiled women peered from cruising Mercedes as men wearing kaffiyehs danced in BMWs, their torsos protruding through the sunroofs.

Costumed little girls waved Kuwaiti flags from the windows of beribboned, gleaming Chevrolets, in a raucous, rolling celebration of the independence granted this rich emirate 25 years ago last month. Occasional, incongruous strains of "La Cucaracha" and "Oh, Susanna" could be heard through the deafening sundown cacophony.

The revelry went on for a month, undiminished by the most threatening offensive in the 5 1/2-year Persian Gulf war unfolding virtually on Kuwait's doorstep.

"This is the first real celebration these people have had in years," one diplomat said. "But it's typically Kuwaiti," said another. "They do it in their cars."

Kuwait, unique in the Persian Gulf region for its carefully nurtured democratic principles and the relatively mature wealth its oil resources have brought it, has much to celebrate.

Oil prices may be plunging, but the country's long-cultivated investments overseas are expected to bring it revenues of more than $5 billion this year, a healthy sum for a nation of 1.7 million people, less than half of whom are Kuwaiti citizens. And unlike many other oil producers, Kuwait is believed to be in a good position to increase production to compensate for lower prices.

Although the ruling Sabah family remains paramount, as it has through poverty and riches for more than 200 years, the relative freedom of the local press and the often heated debate in the region's only genuine parliament have brought a sense of democratic stability.

But the war is a constant presence. Kuwait, despite its attempts to steer a neutral diplomatic course as a peacemaker, and despite the fact that no troops have crossed its borders, is deeply, dangerously involved.

The Iran-Iraq conflict is not just a matter of mass troop movements, air strikes and artillery barrages such as those raging just across the frontier at the Iraqi port of Faw for the last few weeks. This is also a war fought on an oil-fed economic battlefield and in the borderless terrain of terrorism. And Kuwait, participating in the first, has been a victim of the second.

Although it maintains diplomatic relations with both Iran and Iraq, Kuwait is clearly one of Baghdad's most important allies in the conflict. According to diplomatic sources, Soviet arms are regularly unloaded at Kuwait's main port and trucked north across the border to Iraq.

Kuwait and Saudi Arabia have been selling and shipping for Iraq about 310,000 barrels of crude a day, a portion of the oil produced in what is known as the neutral zone, where the three countries' borders converge.

As they have increased production they have been instrumental in the precipitous drop in oil prices, which the Saudis and Kuwaitis can afford, but Iran cannot. Iran already is pumping almost as much oil as it can.

"The Saudis and Kuwaitis can squeeze Iran by economic means and the only way Iran can retaliate is by military means," observed one European ambassador.

As Iran opened a second military front against Iraq, it brought the economic battle into the open with a stark threat. Iranian President Ali Khameini warned recently that Iran might begin confiscating oil shipped through the gulf that is produced for Iraq by its allies.

"Some of these countries are vulnerable," Khameini said, suggesting without elaboration on Tehran Radio that Iran could take "resolute measures in this regard."

The Iranian president spoke in terms of recognized international law and the rights of belligerents to board ships, as Iran now does regularly in the gulf to search for Iraqi-bound war materiel.

On Feb. 28, the West German news agency reported from Tehran that Iranian parliamentary Speaker Hashemi Rafsanjani issued a veiled threat to take military action against Saudi Arabia and Kuwait unless the two countries agreed to cooperate in raising oil prices:

"At this stage we are exerting our utmost efforts through negotiations, with our military operations inside Iraq intended as a warning."

Despite a vast supply of sophisticated American, British, French and Soviet arms, Kuwaitis readily admit that their country, slightly larger than Connecticut, is indefensible.

At most, they hope that their armed forces, now on full alert, would resist an aggressor long enough to allow diplomatic talks.

Government loyalists argue that Iranian-inspired terrorism has left Kuwait little choice but to back Iraq even when other gulf states have adopted a more even-handed stance.

They point to Iran's alleged role in December 1983 suicide-bomb attacks against the U.S. and French embassies and Kuwaiti installations, the hijacking to Tehran of a Kuwaiti Airways plane a year later, an attempt last May on the life of Kuwait's ruling emir, Sheik Jabir Ahmed Sabah, and later bombings of outdoor cafes.

Iran repeatedly has denied any involvement in terrorism against Kuwait, but few Kuwaitis or western diplomats here doubt that at least some Iranian factions have been closely linked to terrorist attacks here. They are also deeply suspicious of Iran's Arab ally, Syria.

"Personally," said a diplomat with long experience here, "I think Iran would never invade Kuwait." Such a move could easily trigger a major escalation of the war. "I think if they want it, they would take it from the inside," the diplomat suggested.

The coordinated series of bombings on Dec. 12, 1983, now is believed by many diplomats to have been aimed at just such a move.

The 17 persons who were arrested and convicted of the crimes -- mostly Iraqi and Lebanese Shiites with ties to Iran -- have become pivotal figures in a wave of terrorism, and their release has been demanded as the price of freeing six American hostages in Lebanon.

Kuwait has refused to release the 17 prisoners or even to discuss the matter with intermediaries. When Anglican Church envoy Terry Waite applied for a visa here in his efforts to win the freedom of the American hostages in Lebanon, he was refused. Kuwaiti newspapers, far from condemning the action, openly wondered why the government had not executed three of the prisoners who were sentenced to death in 1984.