Saudi Arabia's Crown Prince Mohammed bin Salman left Turkey on Wednesday, wrapping up the third and final leg of a regional tour that included Egypt and Jordan.
Prince Mohammed was seen off from Ankara by Turkish President Recep Tayyip Erdogan, Saudi state media reported.
The royal was on his first official visit to Turkey since becoming crown prince in 2017.
He arrived on Wednesday, driven in a Mercedes limousine from Esenboga Airport to Mr Erdogan’s palace in Ankara’s northern suburbs.
The car was accompanied by horsemen in light blue tunics and the prince emerged to be greeted by Mr Erdogan. The two leaders stood in a pavilion as they listened to their countries’ national anthems being played by a military band.
Prince Mohammed and Mr Erdogan then inspected an honour guard that included soldiers dressed as ancient Turkic warriors.
The leaders held a bilateral meeting, attended by Prince Mohammed's delegation and senior Turkish officials. No public statements were made during the visit.
Saudi state media reported that Mr Erdogan welcomed Prince Mohammed to "his second country", while Prince Mohammed thanked Mr Erdogan for the warm welcome he and his delegation received.
Last week, Mr Erdogan said talks with the prince would be focused on raising Turkish-Saudi Arabian relations to a “much higher degree”.
The prince's trip to Ankara follows Mr Erdogan’s April visit to Saudi Arabia after tension was heightened by the killing of Saudi journalist Jamal Khashoggi in 2018.
Turkey is currently undergoing its worst economic crisis in two decades. Mr Erdogan will be hoping for financial support at a critical time, with next year's elections looming.
As a result of the warming relations, Riyadh has already lifted an informal boycott of Turkish goods that cut Ankara’s exports to the kingdom by 90 per cent.
Earlier negotiations led to the removal of restrictions on trade, air travel and the broadcast of popular Turkish TV shows in Saudi Arabia.
During Prince Mohammed’s visit, deals on energy, economy and defence are to be signed, Turkish pro-government media reported. The Saudis are said to be keen to purchase Turkey’s Bayraktar armed aerial drones that have proved effective in warzones in Ukraine, Syria, Libya and Nagorno-Karabakh.
Mr Erdogan and Prince Mohammed, who posed for photographers in front of the presidential palace before heading inside, were also due to hold private discussions about a potential currency swap deal, Reuters reported. Turkey has burnt through much of its foreign currency reserves over the year in a bid to prop up its ailing lira.
US President Joe Biden is scheduled to visit Saudi Arabia next month.