David Ignatius of the Washington Post dropped a bomb last month, citing unnamed sources claiming Turkey “disclosed to Iranian intelligence the identities of up to ten Iranians who had been meeting inside Turkey with their Mossad case officers.”

U.S. officials reportedly regarded the exposure as an “unfortunate intelligence loss.” This is an understatement. “Years of Israeli espionage have been undone,” said John Schindler, a former officer at the National Security Agency, noting the impact could be “devastating.”

It’s no secret that Turkey under Prime Minister Recep Tayyip Erdoğan has little love for the Israelis, particularly after the clash between Israeli commandos and Turkish activists seeking to break the blockade of Gaza in 2010. But would a NATO ally abet Iran getting closer to a nuclear weapon just to spite a foe?

Turkey may be more invested in Iran’s advances than previously believed.

In 2012, press reports indicated that Turkey's state-owned bank, Halkbank, was executing “gas-for-gold” transactions with Iran, which helped Tehran circumvent sanctions designed to halt its illicit nuclear program. As Reuters reported, Turkey purchased Iranian natural gas in Turkish lira, and transferred the proceeds to Halkbank accounts. Iranian gold traders then took those funds and bought gold, which was subsequently shipped off to Dubai and sold for cash.

Cash, of course, has been scant for the sanctions-struck Iranians. And gold helped to make up the shortfall.

At the time, Turkey's Deputy Prime Minister Ali Babacan unabashedly admitted, Turkey's "gold exports [to Iran] end up like payments for our natural gas purchases." And there was no reason to hide it: The sale of gold was technically legal, but it was a crafty work-around that was designed to exploit a loophole in the sanctions regime by allowing the Iranians to use private buyers to buy gold on behalf of the government of Iran.

In January 2013, the Obama administration moved to plug this loophole, placing a prohibition on all gold sales to Iran. Inexplicably, the administration did not make the sanctions effective right away. Rather, the prohibition was delayed for six months, effective July 1, 2013, which gave Turkey and Iran one last bite at the apple.

By all accounts, it was a rather big bite, too. According to the Turkish newspaper Hurriyet, Turkey's gold exports to Iran rose twofold in March, totaling some $381 million. Iran's state-owned Press TV reported in April that Turkey and Iran had inked a gold deal worth $120 million. A May report by Foundation for Defense of Democracies and Roubini Global Economics estimates that "Iran's golden loophole" yielded a windfall of $6 billion since July 30, 2012.

Meanwhile, Iran in recent years has established a number of Iranian companies on Turkish soil that help it circumvent sanctions and acquire material for the nuclear program.

As of November 2012, over 2,100 Iranian companies were operating in Turkey. Most of them probably have nothing to do with proliferation or sanctions busting. There have been several troubling cases, however. In 2011, for example, an Iranian businessman was revealed to be working with two Turkish firms procuring parts for Iran’s missile program. The following year, a German procurement network was discovered to be using a Turkish front company to transfer material to Iran’s Arak nuclear reactor. More recently, in March 2013, another Iranian procurement network was discovered in Germany with fronts in Turkey.

As it turns out, Turkey does not have a vetting mechanism to prevent this activity. But the lack of concern over the impact that these firms might have on Iran’s nuclear program just doesn’t add up.

A 2010 PowerPoint presentation attributed to Turkey’s Ministry of Foreign Affairs, for example, notes that “Turkey has a principled stance on Iran’s nuclear program: neither Iran nor any other country in the region should acquire or possess nuclear weapons.” In September 2011, Turkey announced its support for NATO’s planned anti-ballistic missile shield as a counter to Iran. And, to put it mildly, the Ankara staked out an unwavering anti-Iran position when the civil war broke out in Syria in 2012.

But could Turkey’s position have shifted? Around the time news of the gas-for-gold scheme broke, the office of Iranian President Mahmoud Ahmadinejad issued a statement attributed to Erdoğan, asserting that "Turkey has always clearly supported the nuclear positions of the Islamic republic of Iran, and will continue to firmly follow the same policy in the future."

It could also be that Hakan Fidan, the head of Turkey’s National Intelligence Organization (MiT), precipitated this shift. When Fidan assumed his position in 2010, the Israeli newspaper Haaretz reported that Israel’s Mossad believed Fidan was too close to Iran. Israeli defense minister Ehud Barak described Fidan, who was part of at least one known Turkish delegation to Tehran in March 2012, as a “friend of Iran” and warned that secrets shared with Turkey “could become open to Iran” because of Fidan. Israeli intelligence officers have since reportedly derided Fidan as “the MOIS [Iranian intelligence] station chief in Ankara” to their American counterparts.

This, of course, raises questions as to why the Israelis would rely upon Fidan and the MiT. Reuel Marc Gerecht, a former CIA case officer who worked in Turkey, commented, “My guess is that Israelis have been quite sloppy with tradecraft for years in Turkey, and they were unwilling to deploy NOCs [non-official cover] for these operations….If so, Mossad should really be scorched for its tradecraft.”

Lazy Israeli spycraft or not, Turkey appears to have deliberately burned the Israelis. More to the point, this episode appears to have benefited the Iranian nuclear program. And as the record suggests, this is not the first time the Turks have given the Iranians a boost as they move closer to the bomb.

Jonathan Schanzer, a former terrorism-finance analyst at the U.S. Department of the Treasury, is vice president for research at Foundation for Defense of Democracies and author of State of Failure: Yasser Arafat, Mahmoud Abbas and the Unmaking of the Palestinian State (Palgrave Macmillan).