Iran test fires a Chinese-made Silkworm missile in this undated handout file photo. Reuters A recently disclosed CIA document suggests that the US military's around-the-clock satellite imagery analysis helped Saudi Arabia foil a planned Iranian attack on its offshore oil rigs in 1987.

An article titled "We Watched the Gulf," which appeared in Studies in Intelligence, the CIA's newly declassified internal journal, describes how the US upped its surveillance efforts in the region during a highly fraught moment in the Gulf region's recent history.

In the late 1980s, as the catastrophic Iran-Iraq war approached its end, the US military's Priority Exploration Group (PEG), which analyzed images captured from space, was ordered to focus all of its attention on the Persian Gulf.

In October 1987, the US's increased surveillance in the region helped foil a plot that might have left parts of Saudi Arabia's oil infrastructure in flames, with untold political and economic consequences during a time when Middle Eastern states had a veritable death-grip on world oil markets.

Earlier that year, PEG found that the Iranian Revolutionary Guards had been building a "small boat force" in the northern Persian Gulf, equipped with automatic weapons and rocket launchers.

Around 60 of these nimble attack ships were turned back by the Saudi Royal Navy during one engagement in 1987. The Saudis backed Saddam Hussein's regime in the Iran-Iraq war, and Iran frequently harassed Saudi oil tankers in the Gulf. The armada was apparently headed for Saudi-owned oil platforms.

The article in Studies in Intelligence strongly implies that the Saudis repelled the attack thanks to US satellite intelligence. It's a notable, if long-secret instance in which the US effectively intervened in a complex Middle Eastern conflict, and used its unmatched intelligence capabilities to prevent an already-tense situation from spiraling even further out of control.

Iran wanted to attack Saudi oil assets because of their support for Iraq during the war. But this was just one incident in an alarming and fragile situation in the Persian Gulf that had directly drawn in the US military.

The US focused its attention on the Persian Gulf in the context of Operation Earnest Will, the world's largest maritime convoy operation since World War II, in which the US escorted dozens of Kuwaiti oil tankers through the Straits of Hormuz. This was the so-called "tanker phase" of the Iran-Iraq war, in which both countries tried to choke off their enemy's oil industry by attacking ships sailing to and from their ports.

There was plenty of collateral damage, some of it resulting in the loss of American lives: In May 1987, an Iraqi aircraft fired two missiles at a US frigate. Thirty-seven Navy personnel aboard the USS Stark were killed.

The US was also closely tracking the threat posed by Iranian assets in the Gulf in order to prevent a further escalation — specifically, anti-ship cruise missile sites near the Strait of Hormuz and in the northern Gulf. The US wanted to protect global oil lanes, and prevent future attacks on its own warships.