President Recep Tayyip Erdogan is a skilful politician who knows how to maximise his advantages and this was very much on display in his speech to the Turkish parliament.

He contemptuously dismissed the official Saudi story that the murder of Jamal Khashoggi was the accidental outcome of a botched interrogation by a “rogue” Saudi intelligence team.

It was always naive to imagine that Mr Erdogan would tell all that Turkey knows about the murder and the Saudi role in it because such information – particularly the alleged audio recording of the killing – is invaluable in giving Turkey leverage over Saudi Arabia and, to a lesser degree, the US.

Mr Erdogan disappointed the media by not producing “a smoking gun”, but it is not in his interests to do so for the moment. However, he was categorical in showing that the killing of Mr Khashoggi was premeditated. “Intelligence and security institutions have evidence showing the murder was planned,” he said. “Pinning such a case on some security and intelligence members will not satisfy us or the international community.”

This unlikely narrative is, of course, exactly what Saudi Arabia is trying to sell to the rest of the world. Mr Erdogan did not mention Crown Prince Mohammed bin Salman by name. But then he does not have to. All he had to say was that “from the person who gave the order to the person who carried it out, they must all be brought to account”. The nation has repeatedly denied any suggestion that the crown prince may have been involved.

The crown prince is discovering, as have many authoritarian leaders in the past, that once you win total control of a country it becomes impossible to talk of ignorance of its crimes.

Mr Erdogan is shooting at an open goal. When Saudi Arabia denied knowing anything about the killing for 17 days and then issued a vague and unconvincing admission of the “rogue operation”, it created a vacuum of information about a story which the whole world is watching with fascinated interest. This vacuum is being filled by unattributable briefings by Turkish officials, drip-fed to the Turkish and international media at a pace geared to keep the finger pointing at Riyadh and the affair at the top of the news agenda.

The Saudi admission on 19 October that Mr Khashoggi was killed has made things worse rather than better for them. Their feeble cover story is already in shreds. Mr Erdogan is very reasonably asking what has happened to the body and what are the names of the Turkish “collaborators” to whom Riyadh is claiming operatives have handed over the corpse.

ORDER IT NOW

The problem for Saudi Arabia is that any attempt to explain away its role in the killing is likely to be immediately discredited by Turkish leaks. It is almost certain that the audio recording of Mr Khashoggi’s final moments really exists and will finally be made public. Meanwhile, it enables Turkey to pile on the pressure on the kingdom in the knowledge that it holds all the high cards.

It will play these cards very carefully because, once revealed, they lose their value. For Turkey, the Khashoggi affair has provided an unexpected and miraculous opportunity to recalibrate its relations with Saudi Arabia and the US to its own advantage. The Saudi bid to be the undisputed leader of the Sunni Muslims, although never really convincing and always overstating the kingdom’s strength, is dissolving by the day. Mr Erdogan can look to extract concessions – although he may not get them – from Saudi Arabia when it comes to the war in Yemen, the blockade of Qatar and confrontation with Iran, as well as financial benefits.

Whatever happens, the aggressive, arrogant but disaster-prone Saudi foreign policy over the last three years under the leadership of the crown prince is likely to be thoroughly diluted in future.

Mr Erdogan will be looking to modify the stance of the US towards Turkey on issues such as the US alliance with the Syrian Kurds, whose enclave in Syria Ankara denounces as being run by the Syrian branch of the Kurdistan Workers Party (PKK), which the Turkish state has been fighting since 1984.

This is a delicate moment for President Trump. The Khashoggi affair may not much effect the midterm elections, but it will affect the US position in the world. Mr Trump’s most radical change of policy has been to exit the Iran nuclear deal and to reimpose severe sanctions on Iranian oil exports in early November. The main US regional ally in this was to have been the Crown Prince Mohammed bin Salman as the de facto ruler of Saudi Arabia, but this strategy is in deep trouble. Turkey has close if shaky relations with Iran and says it will not comply with sanctions. Saudi Arabia will go on being an important regional player because of its oil and money, but its prestige and influence have been damaged beyond repair.

If the crown prince does survive then he is likely to be much more under US influence and less likely to act independently than in the past. For the moment, he will be watching the news from Ankara and living from leak to leak.