IT WAS widely expected to spark a fresh burst of anti-Israeli vitriol from Recep Tayyip Erdogan, Turkey’s increasingly paranoid prime minister. Last month an article in the Washington Post claimed that Hakan Fidan, the head of MIT, Turkey’s national spy agency, had outed ten Iranians working for Israel to his colleagues in Iran. In the eyes of Mr Erdogan’s ruling Justice and Development (AK) party the allegations were part of a purported Zionist conspiracy to topple their government. Yet when Israel denied involvement in the leak, Mr Erdogan declared that Turkey must accept Israel’s words.

The prime minister’s dovish pronouncements have been followed by surprise visits to Ankara by the foreign ministers of Iran and Iraq. Turkey now says it will not import oil from Iraq’s Kurds without the Iraqi central government’s consent, easing worries that Turkey is encouraging Kurdish independence. Mr Erdogan is said to be eyeing a trip to Baghdad to coincide with the 10th day of the holy fast on November 13th when Shias around the world mourn the death of the Imam Husain.

All of this is helping to feed speculation that Mr Erdogan is reviving Turkey’s much-vaunted “zero problems with neighbours” policy. This would be welcome news. The tired joke on the Ankara cocktail circuit is that Turkey now has lots of problems—with all its neighbours.

Mr Erdogan’s embrace of the parties linked to the Sunni Muslim Brotherhood in its former Ottoman dominions has prompted accusations of sectarianism. Turkey’s Western friends are every bit as alarmed as Shia leaders in Iran and Iraq about its coddling of jihadists fighting Syria’s president, Bashar Assad, as well as Syrian Kurds. Turkey’s strident calls for Muhammed Morsi to be returned to power have angered Egypt’s new leaders and chilled the friendship with Saudi Arabia.

Worst of all, Mr Erdogan’s honeymoon with America’s president appears to be over. In March Mr Obama had talked Israel’s prime minister, Binyamin Netanyahu, into apologising for the deaths of nine Turkish citizens during an Israeli raid in 2010 on the Mavi Marmara, a Turkish aid flotilla bound for Gaza. But Mr Erdogan’s subsequent Israel-bashing, including his claim that Israel had engineered Mr Morsi’s deposition, are said to have infuriated Mr Obama and dampened hopes of Turkish-Israeli reconciliation.

The rift with Washington deepened following Turkey’s announcement in September that it was planning to co-produce a missile-defence system with a Chinese company that is under American sanctions for its dealings with Syria, North Korea and Iran. NATO’s secretary-general, Anders Fogh Rasmussen, has warned that the Chinese equipment, which is meant to protect Turkey against a possible attack by Syria or Iran, is not compatible with those of other NATO members. Aaron Stein, a Geneva-based non-proliferation expert, reckons that the Chinese kit may be “good against drones and aircraft but not against missiles”.

Turkey picked the Chinese missile because it was vastly cheaper than its European and American rivals. The Chinese also agreed to share technology that will purportedly enable Turkey to produce and export its own missiles. This fits with Mr Erdogan’s dreams of leading an Islamic superpower. A senior Turkish official confided that Mr Erdogan’s sycophantic advisers were “too scared” to tell him of the potential harm to Turkey’s ties to NATO.

Mr Erdogan insists that he will go ahead with the Chinese deal. Many speculate that this is merely a bargaining tactic calculated to force the Europeans and the Americans to offer better terms. Ahmet Davutoglu, the foreign minister, has noted that “no final decision” has been made.

In spite of these twists and about-turns, talk of a Turkish foreign policy “reset” looks premature. The overtures to Iraq have more to do with pressure from Turkish businessmen, who say they are paying the price for Turkey’s quarrels abroad. Those to Iran were mainly prompted by Mr Obama’s own overtures to the Islamic Republic. Even Mr Erdogan’s pious base is worried about his obsession with overthrowing Mr Assad. The flood of Syrian refugees in Turkey has now swollen to more than 700,000. Resentment towards them is rising. Although Turkey has made a big show of arresting suspected al-Qaeda militants in recent months, not everyone is swayed. “I don’t see any sign that Turkey is taking serious measures to clamp down on the inflow of foreign fighters into Syria,” observes Aymenn Jawad Al-Tamimi, an Oxford-based expert on Islamic militant groups. “The arrests are cosmetic.”