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.

Trump says he is not satisfied with Saudi account of journalist Jamal Khasoggi's death

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.

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.

Khashoggi disappearance: Forensic police investigate Saudi consul Show all 12 1 /12 Khashoggi disappearance: Forensic police investigate Saudi consul Khashoggi disappearance: Forensic police investigate Saudi consul According to local media reports, Saudi consul Mohammad al-Otaibi left Turkey on 16 October. A Turkish prosecutor on 15 October has entered the Saudi consulate in Istanbul to investigate the disappearance of dissident Saudi journalist Jamal Khashoggi, an inspection that was being carried out jointly with a Saudi team AFP/Getty Images Khashoggi disappearance: Forensic police investigate Saudi consul Turkish forensic police officers work on the roof of the residence of the Saudi consul in Istanbul EPA Khashoggi disappearance: Forensic police investigate Saudi consul Khashoggi went missing on 2 October when he entered the Saudi consulate to pick up paperwork AP Khashoggi disappearance: Forensic police investigate Saudi consul ISTANBUL, TURKEY - OCTOBER 17: Turkish police arrive to investigate the Saudi Arabian consulate general residence as investigations continue into the disappearance of journalist Jamal Khashoggi on October 17, 2018 in Istanbul, Turkey. Turkish police first entered and searched the Saudi Arabian consulate on October 15 amid a growing international backlash about the disappearance. Khashoggi, a U.S. resident and critic of the Saudi regime, has been missing since visiting the Saudi Arabian consulate on October 2. Turkish officials have said they believe he was killed inside. (Photo by Chris McGrath/Getty Images) ***BESTPIX*** Chris McGrath Khashoggi disappearance: Forensic police investigate Saudi consul Turkish forensic and investigation officers arrive at Saudi Consul's residence on October 17, 2018 in Istanbul. - Saudi Arabia's consul to Istanbul Mohammed al-Otaibion on October 16, 2018 left the Turkish city bound for Riyadh on a scheduled flight, reports said, as Turkey prepared to search his residence in the probe into the disappearance of journalist Jamal Khashoggi. (Photo by OZAN KOSE / AFP)OZAN KOSE/AFP/Getty Images OZAN KOSE AFP/Getty Images Khashoggi disappearance: Forensic police investigate Saudi consul Turkish police arrive to investigate the Saudi Arabian consulate general residence Getty Images Khashoggi disappearance: Forensic police investigate Saudi consul Turkish forensic police search for evidence at the garden of the Saudi Arabia's Consul General Mohammad al-Otaibi AFP/Getty Images Khashoggi disappearance: Forensic police investigate Saudi consul Turkish police search the rooftop of the Saudi Arabian consulate general residence Getty Images Khashoggi disappearance: Forensic police investigate Saudi consul Turkish police arrive at the residence of the Saudi consul General Mohammed al-Otaibi to conduct a search AP Khashoggi disappearance: Forensic police investigate Saudi consul Turkish police officers gather as they prepare to enter Saudi Arabia consul's residence, in Istanbul, Wednesday, Oct. 17, 2018. America's top diplomat is in Turkey, where a strongly pro-government newspaper has published a gruesome recounting of the alleged slaying of Saudi writer Jamal Khashoggi at the Saudi Consulate in Istanbul. (AP Photo/Petros Giannakouris) Petros Giannakouris AP Khashoggi disappearance: Forensic police investigate Saudi consul Turkish forensic police search for evidence at the garden of the Saudi Arabia's Consul General Mohammad al-Otaibi AFP/Getty Images Khashoggi disappearance: Forensic police investigate Saudi consul ISTANBUL, TURKEY - OCTOBER 17: Turkish police search the rooftop of the Saudi Arabian consulate general residence as investigations continue into the disappearance of journalist Jamal Khashoggi on October 17, 2018 in Istanbul, Turkey. Turkish police first entered and searched the Saudi Arabian consulate on October 15 amid a growing international backlash about the disappearance. Khashoggi, a U.S. resident and critic of the Saudi regime, has been missing since visiting the Saudi Arabian consulate on October 2. Turkish officials have said they believe he was killed inside. (Photo by Chris McGrath/Getty Images) Chris McGrath Getty Images

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.

Support free-thinking journalism and attend Independent events

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.