Ties between the two former allies have been strained since then Egyptian army chief Abdel Fattah el-Sisi toppled elected president Morsi of the Muslim Brotherhood in 2013 after mass protests against his rule.
Egyptian security forces then mounted a fierce crackdown against the Brotherhood, killing hundreds of its supporters as they protested in Cairo, arresting thousands and putting Morsi and other leaders on trial.
"Mr Morsi is a president elected by 52 percent of the votes. They should give him his freedom," Erdogan was quoted by Turkish newspapers as telling reporters as he returned from an official visit to Iran.
An official from Erdogan's office confirmed his comments.
Morsi's Muslim Brotherhood has close ties with Turkey's ruling AK Party, which Erdogan co-founded and which has emerged as one of the fiercest international critics of Morsi's removal, calling it an "unacceptable coup" by the army.
Erdogan's recent visit to Saudi Arabia, and his support of a Saudi-led military operation against Houthi rebels in Yemen in which Egyptian warships have taken part, had triggered speculation about a possible thaw in ties between Ankara and Cairo.