Aliyev helped resolve the historical conflict over Karabakh in a meeting with Erdogan.
Turkish President Recep Tayyip Erdogan told the Azerbaijani leader on Tuesday that he wants to prevent future border tensions with Armenia from flaring up and pursue sustainable peace with Baku.
Azerbaijani President Ilham Aliyev, after rare talks with Armenian Prime Minister Nikol Pashinyan hosted by the German chancellor, arrived in Ankara.
Deadly clashes along the Azerbaijan-Armenia border last week, which Yerevan said resulted in the killing of four Armenian soldiers, raised fears of escalating hostilities.
The German Chancellor said Aliyev and Pashinyan agreed to strive for peace and refrain from resorting to force.