On April 9, 1972, Iraq and the Soviet Union signed an historic agreement. The USSR committed to arming the Arab republic with the latest weaponry. In return for sending Baghdad guns, tanks and jet fighters, Moscow got just one thing — influence … in a region that held most of the world’s accessible oil.

In neighboring Iran, news of Iraq’s alliance with the Soviets exploded like a bomb. Ethnically Persian and predominately Shia, Iran was — and still is — a bitter rival of Iraq’s Sunni Arab establishment, which during the 1970s dominated the country’s politics.

In Tehran, King Mohammad Reza Shah Pahlavi — the “shah” — moved quickly to counter Baghdad’s move. First he set loose an army of secret police in a desperate and bloody bid to quell internal dissent. And then he reached out to the United States.

The shah wanted weapons. And not just any weapons. Himself a former military pilot, the king wanted the latest and best U.S.-made warplanes, with which the Iranian air force might dominate the Persian Gulf and even patrol as far away as the Indian Ocean.

The Iranian leader’s appetite for planes was notorious. “He’ll buy anything that flies,” one American official said of the shah. But Pahlavi was especially keen to acquire a fighter that could fly fast enough and shoot far enough to confront Soviet MiG-25 Foxbat recon planes that had been flying over Iran at 60,000 feet and Mach 3.

The administration of U.S. president Richard Nixon was all too eager to grant the shah’s wish in exchange for Iran’s help balancing a rising Soviet Union. Nixon and his national security adviser Henry Kissinger visited Tehran in May 1972 — and promptly offered the shah a “blank check.” Any weapons the king wanted and could pay for, he would get — regardless of the Pentagon’s own reservations and the State Department’s stringent export policies.

That’s how, starting in the mid-1970s, Iran became the only country besides the United States to operate arguably the most powerful interceptor jet ever built — the Grumman F-14 Tomcat, a swing-wing carrier fighter packing a sophisticated radar and long-range AIM-54 Phoenix air-to-air missiles.

It’s fair to say American policymakers quickly regretted giving Iran the F-14s. In February 1979, Islamic hardliners rose up against the shah’s police state, kidnapping 52 Americans at the U.S. embassy in Tehran and ushering the return of Ayatollah Ruhollah Khomeini. The Islamic Revolution transformed Iran from an American ally to one of the United States’ most vociferous enemies.

An enemy possessing 79 of the world’s most fearsome interceptors.

For the next five decades, the United States would do everything in its power — short of war — to ground the ayatollah’s Tomcats. But the Americans failed. Through a combination of engineering ingenuity and audacious espionage, Iran kept its F-14s in working order — and even improved them. The swing-wing fighters took to the air in several conflicts and even occasionally confronted American planes.

Today Iran’s 40 or so surviving F-14s remain some of the best fighters in the Middle East. And since the U.S. Navy retired its last Tomcats in 2006, the ayatollah’s Tomcats are the only active Tomcats left in the world.

The F-14 was a product of failure. In the 1960s, the Pentagon hoped to replace thousands of fighters in the U.S. Air Force and Navy with a single design capable of ground attack and air-to-air combat. The result was the General Dynamics F-111 — a two-person, twin-engine marvel of high technology that, in time, became an excellent long-range bomber in Air Force service.

But as a naval fighter, the F-111 was a disaster. Complex, underpowered and difficult to maintain, the Navy’s F-111B version — which General Dynamics built in cooperation with carrier-fighter specialist Grumman — was also a widowmaker. Of the seven F-111B prototypes that the consortium built starting in 1964, three crashed.

In 1968, the Defense Department halted work on the F-111B. Scrambling for a replacement, Grumman took the swing-wing concept, TF-30 engines, AWG-9 radar and long-range AIM-54 missile from the F-111B design and packed them into a smaller, lighter, simpler airframe.

Voila — the F-14. The first prototype took off on its inaugural flight in December 1970. The U.S. fleet got its first Tomcats two years later. Grumman ultimately built 712 F-14s.

In 1974, the shah ordered 80 of the fighters plus spare parts and 284 Phoenix missiles at a cost of $2 billion. Seventy-nine of the Tomcats arrived before the Islamic Revolution forced the shah into exile in Egypt and compelled the United States to impose an arms embargo. The U.S. Navy eventually scooped up the 80th plane for one of its test squadrons.

The U.S. State Department oversaw the F-14 transfer and, in its eternal wisdom, delegated most of the work to the Air Force. But the F-14 was a Navy plane and only the Navy had pilots qualified to fly the machine. The sailing branch seconded Tomcat crews to the flying branch, but only after extensive security checks lasting six months — and not without some culture clash.

The Navy pilots picked up the brand-new Tomcats at the Grumman factory in Long Island, New York and flew them three at a time to Iran. “Few pilots in their careers ever have the opportunity to fly an airplane that ‘smells’ exactly as a new car, and still has cellophane covering the cushions of the ejection seat,” one F-14 flier wrote years later . “Well, I had that amazing experience.”

“Although my F-14 was ‘factory fresh,’ it had an Iranian specified camouflage paint scheme. And while it did have U.S. military markings, as I found out later, those markings would be ingeniously and quickly changed upon arrival in Iran. The U.S. paint easily disappeared when a certain solution was applied, thus exposing the Iranian air force markings underneath.”

The journey to Iran involved two legs — from Long Island to Torrejon, Spain, and then onward to Iran’s Isfahan air base, with Air Force KC-135 aerial tankers constantly attending to the F-14s.

It was a complex and, for the pilots, uncomfortable undertaking. “We needed to be ‘topped-off’ with fuel for most of the seven-hour flight in case we had to divert to an emergency field,” the ferry pilot wrote.

“This meant at least six in-flight refueling events for each leg, despite some weather conditions — and the KC-135’s difficult, Rube Goldberg type of refueling hose to accommodate Navy aircraft.”

Air Force planes refuel in mid-air via a probe extending from the tanker into the receiving plane’s fuselage — the tanker crew does most of the work. Navy aircraft have their own probes and refuel by maneuvering the probe into a basket dangling from the tanker’s underwing fuel pods. The receiving pilot does the work — an arrangement consistent with the incredibly high demands the Navy traditionally places on its combat pilots.

To make the KC-135s compatible with the F-14s, the Air Force awkwardly fitted a basket to the tankers’ probes. The improvised contraption tended to whip around in the air, threatening to smash the Tomcats’ canopies every time they refueled.

Keeping gassed up wasn’t the only source of stress for the Tomcat ferry crews. “People often wonder, and it is rarely discussed — how did you relieve yourself, strapped into an ejection seat and immobile for seven-plus hours?” the pilot wrote.

The Navy offered the fliers diapers, but some refused to wear them. “I personally held it for seven hours … as I had planned and for which I had prepared by remaining dehydrated. Hey, I’m a fighter pilot.”

“However, upon arrival in Torrejon, I could barely salute the welcoming Air Force colonel,” the pilot continued. “Bending over and doubled-up under pressure, I feverishly ran to the nearest ‘head’ to relieve myself — for seemingly and refreshingly forever, before I could then return to properly meet, greet and properly salute the receiving Air Force colonel.”

While the U.S. Air Force and Navy worked together to deliver Iran’s F-14s, the State Department arranged for Iranian aviators and maintenance technicians to get training on the Tomcats and their complex systems. Some of the Iranians attended classes in the United States, others received instruction from American contractors in Iran. By 1979, the Americans had trained 120 pilots and backseat radar intercept officers.

The shah’s Tomcat squadrons were coming to life. But the Iranian king wasn’t entirely happy with his acquisition. In late 1975, the shah complained to the U.S. embassy in Tehran that Grumman had paid agents in Iran $24 million to facilitate the F-14 sale. The shah considered the payments bribes — and wanted Grumman to take the money back.

“Shah views with bitter scorn corrupt practices of agents for U.S. companies and ineffective [U.S. government] efforts to deal with problem,” the embassy reported back to Washington in January 1976. The shah was so angry that he threatened to halt payments to Grumman. Washington reminded Tehran that failure to pay would amount to breach of contract.

“The dispute over agents fees was poisoning U.S.-Iranian relations,” American diplomats in Tehran warned. Amid the diplomatic tension, Tehran put its Tomcats to good use performing the mission for which Iran originally wanted them — deterring the Soviet Union’s MiG-25 spy planes. In August 1977, Iranian F-14 crews shot down a BQM-34E target drone flying at 50,000 feet. “The Soviets took the hint and Foxbat over flights promptly ended,” Iranian air force major Farhad Nassirkhani wrote .

Tehran’s spat with Grumman continued, but a year and a half later the Islamic Revolution intervened and rendered the issue moot. Revolutionaries took the streets. Violence broke out. On Jan. 16, 1979, the shah fled.

Twenty-seven of Iran’s freshly-minted F-14 fliers fled , too. On their own way out of the country, American technicians working for Hughes, the company that manufactured the Phoenix missile, sabotaged 16 of the deadly missiles — or tried to, at least. Engineers loyal to the ayatollah eventually repaired the damaged munitions.

Agents of Iran’s new Islamic regime suspected the remaining F-14 crews of harboring pro-shah and pro-American sentiments. Police arrested at least one F-14 pilot at gunpoint at his home, finally releasing him months later when the regime realized it actually needed trained aircrews if it ever hoped to make use of all those brand-new F-14s lined up on the tarmac at Khatami air base.

By September 1980, Iran and Iraq were at war. Baghdad’s own MiG-25 fighters and recon planes could dash into Iranian airspace unmolested by Tehran’s much slower and lower-flying F-4 and F-5 fighters. Over the course of the eight-year war, MiG-25s shot down more than a dozen Iranian aircraft, including a priceless EC-130 electronic warfare plane. Iraqi pilot Col. Mohommed Rayyan alone claimed eight kills in his MiG-25.

Only the F-14 could challenge the MiG-25.

When war broke out, just 77 Tomcats were left — two had crashed. With crews and maintainers scattered and Tehran cut off from Grumman, Hughes and the U.S. Air Force and Navy, most of the Iranian F-14s were inoperable. The ayatollah’s air force managed to assemble 60 loyal pilots and 24 back-seat radar operators. By stripping parts from grounded Tomcats, technicians were able to get a dozen F-14s in fighting shape.

They immediately flew into action. At first, the Tomcats acted as early-warning and battle-management platforms while less sophisticated planes did the actual fighting. “The planes have not been used in combat,” The New York Times reported in December 1981. “Rather they have stood off from the battle and been used as control aircraft, with their advanced radar and electronics guiding other planes to their targets or warning the pilots of Iraqi aircraft attacks.”

The fighting escalated and drew the F-14s into battle. In eight years of combat, Iran’s Tomcat crews claimed some 200 aerial victories against Iraqi planes, 64 of which the Iranian air force was able to confirm. One F-14 pilot named Jalil Zandi reportedly claimed a staggering 11 air-to-air victories, making him by far Iran’s deadliest fighter pilot of the war.

“The Iraqi high command had ordered all its pilots not to engage with F-14 and do not get close if [an] F-14 is known to be operating in the area,” Nassirkhani wrote. “Usually the presence of Tomcats was enough to scare the enemy and send the Iraqi fighters back.”

At first, the F-14s were armed only with their internal 20-millimeter cannons and the long-range Phoenix missiles. American contractors had not had time to integrate medium-range Sparrow and short-range Sidewinder missiles.

Normal tactics called for F-14 crews to fire Phoenixes at their targets from a hundred miles away or farther, but with no alternative armament Iranian aviators relied on the heavy AIM-54s for close-in fighting, as well — once even hitting an Iraqi plane from just 12 miles away, according to Iranian reporter Babak Taghvaee.

Eight F-14s fell in combat during the war with Iraq — one accidentally shot down by an Iranian F-4; three struck by Baghdad’s Mirage F.1 fighters; one hit by an Iraqi MiG-21; and two falling victim to unknown attackers.

The eighth Tomcat that Tehran lost during the Iran-Iraq war reportedly wound up in Iraq when its crew defected. Taghvaee claimed that U.S. Special Operations Forces infiltrated “deep inside Iraqi territory” in order to destroy the abandoned F-14 and “prevent it falling into Soviet hands.”

Iranian Tomcats intercepted Iraqi MiG-25s on several occasions. But only one Iranian flier succeeded in downing any of the Mach-3 MiGs. In September 1982 and again in December, Shahram Rostani struck MiG-25s with Phoenix missiles.

Combat ops were hard on Iran’s F-14 force. A lack of spare parts compounded the maintenance woes. After the revolution, the United States had frozen Iranian assets, embargoed Iranian trade and imposed other economic sanctions. The United Nations and many U.S. allies followed suit, cutting off Tehran from global supply chains.

In 1981 an Iranian trade agent wrote to the London office of F-14-builder Grumman asking to acquire parts for Iran’s Tomcats. Citing the new sanctions, Washington declined to grant Grumman a license to sell the components. “It is the present policy of the United States government not to permit Grumman or any other defense contractor to obtain a license to provide Iran with these materials,” the Navy told The New York Times.

By 1984, just 15 or so of the twin-engine fighters were flightworthy, according to Nassirkhani. Technicians kept the 15 jets in good repair mainly by taking parts from the roughly 50 F-14s that couldn’t fly.

Starting in 1981, Iranian Aircraft Industries began performing overhauls and upgrades on the F-14s as part of the Tehran’s effort to make the country militarily self-sufficient. The upgrades finally added Sparrow and Sidewinder missiles to the Tomcats. The self-sufficiency program had help from Iranian agents working abroad — and at great risk to themselves — to divert spare parts for the F-14s and other weapon systems.

America begrudgingly helped, too — albeit briefly. In negotiating to free American hostages that an Iran-backed militant group was holding in Lebanon, the administration of Pres. Ronald Reagan agreed to transfer to Tehran badly-needed military equipment, reportedly including Phoenix missiles and bomb racks. Iranian engineers added the bomb racks to four of the F-14s as early as 1985, transforming the Tomcats into heavy ground-attack planes. Years later, the U.S. Navy would modify its own F-14s in the same way.

Rostani flew the “Bombcat’s” first ground-attack mission in 1985, targeting an Iraqi field headquarters … but missing. Frustrated technicians boosted the Bombcat’s weapons load-out with a whopping, custom-made 7,000-pound bomb — one of the biggest freefall munitions ever. As Iranian commander-in-chief Gen. Abbas Babaei observed from near the front line, an F-14 lobbed the massive bomb.

The estimated time on target passed … but nothing happened. Babaei was getting ready to return to his jeep when a powerful blast shook the ground. The bomb had missed, but its psychological effect on Iraqi troops was surely profound.

By the war’s end in 1988, 34 of the 68 surviving F-14s were airworthy. But just two of the Persian Tomcats had working radars. And Iran had expended all of its original consignment of Phoenixes. More Phoenixes reportedly arrived as part of the hostages-for-arms deal with the United States, and in the post-war years Iranian Aircraft Industries experimented with “new” weaponry for the F-14 — including modified Hawk surface-to-air missiles that the shah had bought from the United States as well as Soviet-supplied R-73 missiles.

The experiments added flexibility to the F-14 force, but it was the spare parts that kept the Tomcats in working condition — and the Iranian air force quickly burned through the spares it obtained from the hostage deal. Tehran established self-sufficiency programs — not just in the air force, but across the nation’s economy — in an effort to satisfy material needs that foreign companies had once met.

In many sectors, the self-sufficiency initiative worked. Besides producing all its own oil, Iran has declared itself autonomous in agriculture, steel production, electricity generation and civil aviation. “Well before the advent of abundant oil wealth, Iranians have tended to see their country as a unique nation amply endowed with natural resources that could take care of itself without outside assistance,” said Rudi Matthee, a history professor at the University of Delaware.

But Iranian companies struggled to produce all the specialized parts that the Tomcat requires. In the late 1990s, the air force considered simply buying new planes to replace the F-14s, but China was the only country that would sell fighters to Iran. In 1997 and 1998, Iranian pilots evaluated China’s F-8 … and rejected it. Even deprived of spares and mostly grounded, the F-14s were superior to the Chinese planes in the eyes of Iran’s air force.

Tehran turned to the black market, paying huge sums to shady middlemen to sneak F-14 parts into Iran. American authorities became aware of the illicit trade as early as 1998. In March of that year, federal agents arrested Iranian-born Parviz Lavi at his home in Long Island, charging him with violating U.S. export law by attempting to buy up spare parts for the F-14’s TF-30 engine and ship them to Iran via The Netherlands. Lavi got five years in prison plus a $125,000 fine.

The arrests came in a steady drumbeat. In 1998, an aircraft parts vendor in San Diego told U.S. customs officials that Multicore Ltd. in California had requested price information for air intake seals used only on the F-14. Agents arrested Multicore’s Saeed Homayouni, a naturalized Canadian from Iran, and Yew Leng Fung, a Malaysian citizen.

“Bank records subpoenaed by the Customs Service showed that Multicore Ltd. had made 399 payments totaling $2.26 million to military parts brokers since 1995 and had received deposits of $2.21 million,” The Washington Post reported. The company shipped parts mostly through Singapore.

The feds began investigating 18 companies that had supplied airplane components to Multicore.

In September 2003, U.S. authorities nabbed Iranian Serzhik Avasappian in a South Florida hotel as part of a sting operation. Agents had shown Avasappian several F-14 parts worth $800,000 and arrested him after he offered to buy the components.

“While these components may appear relatively innocuous to the untrained eye, they are tightly controlled for good reason,” Immigration and Customs Enforcement interim agent Jesus Torres said in a statement. “In the wrong hands, they pose a potential threat to Americans at home and abroad.”

Even with U.S. authorities tamping down on the illicit trade in F-14 parts, Iran persisted. After shutting down Multicore, the feds confiscated the firm’s Tomcat components and sent them to the Defense Department’s surplus-parts office. In 2005, a company — allegedly Iranian — bought the very same parts from the military.

The parts war escalated after the U.S. Navy retired its last F-14s in 2006, leaving Iran as the type’s only operator. In 2007, U.S. agents even seized four intact ex-U.S. Navy F-14s in California — three at museums and one belonging to a producer on the military-themed T.V. show JAG — charging that the F-14s had not been properly stripped of useful parts that could wind up in Iranian hands.

The U.S. Congress was furious at the Pentagon for its lax handling of the F-14-parts problem. Rep. Christopher Shays, a Connecticut Republican, described it as “a huge breakdown, an absolute, huge breakdown.” Lawmakers passed a bill specifically banning any trade in Tomcat components to Iran or any other entity, and then-president George W. Bush signed the law in 2008.

A minor tragedy unfolded as the military paid contractors to dismantle, crush and shred many of the approximately 150 retired F-14s. Scores of old F-14s — properly “demilitarized” — are still on display in museums across the United States. But none remain at the famous airplane “boneyard” in Arizona, where the Pentagon stores retired planes just in case it needs them again.

Even so, the underground trade in Tomcat parts continues, with shady companies scouring the planet for leftover components. In early 2014, the U.S. Department of Homeland Security investigated Israeli arms dealers that it said had twice tried to send F-14 spares to Iran.

And it’s not for no reason that Tehran would keep trying to supply its Tomcats. In recent years the United States has stepped up its efforts to spy on Iran, deploying drone aircraft including the secretive, stealthy RQ-170 to the Middle East apparently to surveil Iranian nuclear facilities. An RQ-170 crashed in Iranian territory in 2011.

Tomcats have led the effort to intercept these drones. In the early 2000s, the Iranian air force stationed an F-14 squadron in Bushehr, the site of Iran’s first nuclear reactor. That squadron eventually disbanded as its Tomcats fell into disrepair, but other F-14 squadrons maintained vigil over Bushehr and two other atomic facilities as U.S. spy flights continued to probe the sites, trying to glean intelligence on Iran’s nuclear efforts.

And that’s when things got weird. F-14 crews protecting the facilities reported seeing increasingly sophisticated and bizarre drones, according to Taghvaee. “The CIA’s intelligence drones displayed astonishing flight characteristics, including an ability to fly outside the atmosphere, attain a maximum cruise speed of Mach 10 and a minimum speed of zero, with the ability to hover over the target.”

“Finally,” Taghvaee added, “the drones used powerful [electronic countermeasures] that could jam enemy radars using very high levels of magnetic energy.” In November 2004 one F-14 crew intercepted a suspected CIA drone over the nuke facility at Arak. As the aviators tried to lock onto the drone with their Tomcat’s AWG-9 radar, they “saw that the radar scope was disrupted.” The drone lit its green afterburner and escaped.

To be clear, it’s highly unlikely the CIA possesses hypersonic space-capable drones with radar-killing magnetic ray weapons. The point is that Tehran is protective, even paranoid, when it comes to its nuclear sites — and yet entrusts their defense mainly to the 40-year-old F-14s.

Whether it’s producing parts itself or acquiring them abroad, Iran is clearly succeeding in its efforts to supply its F-14 squadrons. In October 2013, Taghvaee estimated that more than 40 of Tehran’s surviving F-14s were in flyable condition, possibly the highest number since the mid-1970s. Iran has begun upgrading the Tomcats with new radar components, radios, navigation systems and wiring while also adding compatibility with R-73 and Hawk missiles.

Five decades in, Iran’s F-14s are only getting better and better. And more and more important to the Persian state’s defense.