Erdogan, who first visited the martyrdom cemetery as part of his visit on Tuesday, was welcomed by his Azerbaijani counterpart Ilham Aliyev with an official ceremony at the Youth Palace in Baku.
During the ceremony where the national anthems of the two countries were sung, President Erdogan then saluted the welcoming guard.
At the end of the ceremony, during which the Azerbaijani delegation was presented to Erdogan and the Turkish delegation to Aliyev, Erdogan and Aliyev had a bilateral meeting.
Erdogan and Aliyev are expected to hold a delegation meeting and a joint press conference.
Erdogan also visited the Honorary Khiyaban State Cemetery, where the late Azerbaijani leader Heydar Aliyev is buried.
Leaving a wreath at Aliyev's mausoleum and the Eternal Flame Monument at the Baku Martyrs' Cemetery, where the January 20 Martyrs are located, Erdoğan then went to the Baku Turkish Martyrs' Cemetery and signed the memorial book after laying a wreath at the monument there.