Officials in Turkey took to Twitter since Monday to extend their sympathies for the death of ousted Egyptian President Mohamed Morsi.
Presidential Communications Director Fahrettin Altun offered condolences to the Egyptian people and the Muslim world.
"Egypt's first democratically-elected President Mohammed Morsi who was overthrown by a bloody coup before the eyes of the whole world died in the courtroom. May he rest in peace," he said.
"My brother, you are free! May you rest in peace! May God rest your soul!," Justice Minister Abdülhamit Gül also tweeted.
Parliament Speaker Mustafa Şentop expressed deep sorrow for Morsi's death, which came in the courtroom where he faced a slew of charges.
"Condolences to the Egyptian people, Islamic world and all the oppressed people. I believe that his struggle and his life will guide those following him," Şentop wrote on the microblogging site.
"Mursi and his friends are the winners before the justice and history and the putschists are losers. Mursi is a great leader who has the courage to stand on the side of legitimacy. Mursi was imprisoned, but more free than those who imprisoned him," he wrote in a Turkish post.
Interior Minister Süleyman Soylu said: "The struggle of democracy, the struggle of the search for rights and the struggle of the oppressed against the persecution has another martyr today. Of course there will be others, but none will ever be forgotten."
Foreign Minister Mevlüt Çavuşoğlu also offered condolences.
"The coup took him away from power, but his memory will not be erased from our hearts. The Ummah will not forget his firm stance! Rest in peace Morsi," Çavuşoğlu posted.
Ruling Justice and Development (AK) Party's acting chairman Numan Kurtulmuş called Morsi a "martyr" who had been elected by the legitimate votes of Egyptian people and expressed condolences.
"Egypt's first elected President Mohammed Morsi, was being tried in the courtrooms under the control of the junta after an immoral and unlawful coup. He was martyred in the courtroom," AK Party spokesman Ömer Çelik said.
"Those who raised their voices to the coup and searched for ways of appealing fulfilled and are trying to fulfill their duty. But the so-called democratic world could not pass this test. They were silent against the executions and laid the red carpet to the putschists. This shame will always be written on their forehead," he added.
The International Rabia Platform said in a statement that unlike some countries of the "so-called democracy advocates" who supported the junta, Turkey has always taken a stand alongside to the Egyptian people and against the perpetrators of the coup.
The statement offered condolences to the grieving family of the deceased leader, "who was martyred under the oppression of the coup plotters", as well as the Egyptian people and the Islamic world as a whole.
"However, the coup plotters who perpetrated this persecution and killed him are also responsible for the killing of thousands of people who had not yet been asked account," the statement said.
All the governments that support the coup, especially the U.S. and EU member states, as well as some Muslim countries that ignore the will of nations, are the common partners of the regime's murders and persecution, it added.
"The coup plotters, those who openly support the coup and those who remain silent have been condemned to the conscience of humanity," it added.
Morsi was a "hero" not only of Egypt, but of the entire Islamic world and of humanity, the statement said, adding that he stood upright, never buckling under oppression or surrendering to the coup plotters and "defending the trust of the Egyptian people until he was martyred".
The platform's statement also said that the supporters of July 3, 2013 coup against Morsi have also supported the Fetullah Terrorist Organization (FETO), the group behind the 2016 defeated coup in Turkey.
Morsi died Monday during a court appearance to face charges many believed were politically motivated.
The 67-year-old lost consciousness during the string of legal procedures he has been forced to face since his ouster and imprisonment during a 2013 military coup.
There were six criminal charges against the former leader including, jailbreak, murder, spying for Qatar, spying for Hamas and Hezbollah, insulting the judiciary and involvement in terrorism.