Turkey's president admitted for the first time that his country was supplying military equipment to Libyan fighters defending the capital during a wide-ranging and rare meeting with international journalists.

During a two-hour discussion with reporters inside a wing of the ornate Dolmabahce Palace along Istanbul’s Bosphorus Strait, Recep Tayyip Erdogan lambasted his domestic political rivals, sketched out his vision for the region, including ties with nations of the former Ottoman Empire.

He discussed his country's rocky relations with the White House, describing his rapport with Donald Trump as positive, but blaming the US president's subordinates for failing to implement his policies.

“When we have contacts with his subordinates, our people can’t see eye to eye with him,” he said. “When I take a decision, I make sure it gets implemented. If a backward step is taken, it means the bureaucracy is leading you.”

He demanded international action against Egypt for the death in custody of deposed president Mohamed Morsi and Saudi Arabia for the murder of journalist Jamal Khashoggi.

Tensions high as Trump approves new Iran sanctions: In pictures Show all 17 1 /17 Tensions high as Trump approves new Iran sanctions: In pictures Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, their surface-to-air missile is seen as it shoots down a US surveillance drone EPA Tensions high as Trump approves new Iran sanctions: In pictures This photo shows US RQ-4A Global Hawk unmanned surveillance drone. A drone of this model was shot down by Iran on Thursday 21 June AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures An oil tanker is on fire after it was subject to a suspected attacked at the Gulf of Oman on June 13. The US has blamed Iran for the attack Reuters Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, debris from the downed US drone is seen after it was recovered from Iranian waters AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures US President Trump holds up a signed executive order to increase sanctions on Iran on 24 June AP Tensions high as Trump approves new Iran sanctions: In pictures Iranian President Rouhani stated in a televised address that the White House is "afflicted by mental retardation" following the increase in sanctions on 25 June EPA Tensions high as Trump approves new Iran sanctions: In pictures An Iranian navy boat tackles the fire on the Norwegian owned Front Altair oil tanker after it was hit in a suspected attack AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Iran claims that in this picture released by Iran state TV, debris from the downed US drone is seen after it was recovered from Iranian waters AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures A screenshot from a video released by the US Department of Defense that the US claims to show Iranian removing an unexploded limpet mine form the hull of the Japan-owned ship that was attacked in the Gulf of Oman on June 13 Getty Tensions high as Trump approves new Iran sanctions: In pictures An item reportedly found on the Japan-owned oil tanker that was attacked on June 13 in the Gulf of Oman AFP/Getty Tensions high as Trump approves new Iran sanctions: In pictures A handout photograph from the US Department of Defense shows a composite material that the US claim was left behind on the hull of the Japan-owned oil tanker following the removal of an unexploded limpet mine Getty Tensions high as Trump approves new Iran sanctions: In pictures A view from the cabin of an Iranian navy boat as it tackles the fire on the Norwegian owned Front Altair oil tanker after it was hit in a suspected attack EPA Tensions high as Trump approves new Iran sanctions: In pictures Release by US government A picture released by U.S. Central Command shows damage to the hull of the oil tanker Kokuka Courageous. The picture suggests that the ship is 'likely' to have been hit by a mine as the US Secretary of State Mike Pompeo moves to blame Iran for the suspected attack Reuters Tensions high as Trump approves new Iran sanctions: In pictures Smoke billows from an oil tanker after it was subject to a suspected attacked at the Gulf of Oman on June 13 Reuters Tensions high as Trump approves new Iran sanctions: In pictures Release by US government A picture released by U.S. Central Command shows damage to the hull of the oil tanker Kokuka Courageous. The pictures suggests that the ship is 'likely' to have been hit by a mine as the US Secretary of State Mike Pompeo moves to blame Iran for the suspected attack EPA

“We will never allow the tragedy of President Mohammed Morsi to be forgotten, just like we did not agree for the murder of Jamal Khashoggi to be forgotten,” he told reporters over a late breakfast of pastries, cheese, vegetables, and fruit.

Mr Erdogan appeared confident and relaxed just days before closely watched municipal elections for the city of Istanbul. Binali Yildirim, the candidate for Mr Erdogan’s Justice and Development Party (AKP), is facing off for a second time against the dynamic Ekrem Imamoglu of the opposition People’s Republican Party (CHP), after 31 March elections were annulled.

Mr Erdogan had been refraining from playing a heavy role in the election. But he has entered the fray in recent days, and on Thursday he let loose on Mr Imamoglu, describing him as dishonest and incompetent.

“This person, most of what he says are lies,” he said of Mr Imamoglu, who has alleged corruption in Turkey’s largest city. “Our citizens have already seen this fact, and this Sunday they will act accordingly and as a result of such assessments. Thanks to his experience, Yilidrm will win. Administering a huge city is not someone anyone can do.”

Still, he said he would accept the outcome of the vote.

Responding to reporters’ questions, Mr Erdogan vowed to go forward with plans to purchase Russian s-400 anti-aircraft systems, despite US objections, dismissing the possibility of sanctions or being excluded from NATO membership.

He reiterated that the purchase was a “done deal,” and criticised the US for past failures to sell it military equipment. Turkey pursued the purchase of the S-400s after the US refused to sell it Patriot missiles on favourable terms, Turkey has said.

He said Turkey was also unconcerned about being excluded from the purchase of advanced F-35 fighter jets.

“The US did not give us unmanned aerial vehicles,” he said. “We asked them to lease or sell them. What did that bring about? The private sector focused and leaned on this … right now we manage our own UAVs. We are testing a very large armed UAV. We will make our own fighter planes. We do have the brain power.”

Mr Erdogan also suggested Turkey would not abide by US-imposed sanctions on Iran, criticising the US for “coming from 12,000 kilometres away and disturbing the peace and quiet of the Middle East.”

He noted that Turkey needed Iran as a supplier of energy, despite the Trump administration’s removal of a waiver that allowed the country to trade with the Islamic Republic without punishment.

“We have some significant purchases from Iran such as oil and gas,” he said. “The natural gas that I procure from Russia is not enough to keep my citizens warm in the winter.”

But he reserved his most scathing criticism for Egyptian President Abdel Fattah el-Sisi, who seized control of the country in a 2013 coup in which Morsi was deposed. His death this week in a Cairo courtroom has clearly rattled Mr Erdogan, who likened it to the 1961 execution of Turkish president Adnan Menderes at the hands of Turkish generals.

Meeting Turkey's first Communist Mayor

He called for western nations who purport to stand for human rights and democracy to speak out about his fate. He backed UN and human rights advocates’ demands for an international inquiry into Morsi’s death.

“Can you imagine the first elected president of a country struggles for his life or 20 to 25 minutes without the slightest intervention to save his life?” he asked. “Could there be such a murder?”

Mr Erdogan outlined a wide range of regional interests for Turkey, including the 5 million or more Turks who live in Europe, ethnic Turks in Central Asia, and Arabs in former Ottoman countries such as Syria, Somalia, Yemen, and Palestine.

Recently, photos emerged on social media showing Turkish armoured vehicles and drones in the hands of Libyan fighters defending the UN-backed government in Tripoli from the United Arab Emirates and Egyptian-backed warlord Khalifa Haftar’s forces.

Mr Erdogan publicly admitted for the first time that Turkey has been supplying military hardware to the Libyans, flaunting a UN arms embargo. He declined to detail the weaponry, but described the ministry of defence and the Turkish national intelligence agency as key players in the programme.