Erol Olçak and his 16-year-old son Abdullah were shot dead by pro-coup soldiers on the Bosphorous bridge in the city during Friday's attempted coup.

They had been on the bridge to protest against the putsch launched by a group within the military linked to the Gulenist Terror Organization (FETÖ).

Erdogan told the crowd of hundreds chanting Allahu akbar, "God is greatest": "Erol was an old friend of mine."

Unable to control his tears, Erdogan then said: "I cannot speak any further. Condolences to our nation."

He concluded: "May God have mercy on your soul."

Olçak had worked with Erdogan and the ruling Justice and Development Party (AK Party) and had been described as "masterminding" Erdogan's presidential campaign in 2014 by Turkish media.

Among the political figures that attended the funeral along with Erdogan were Parliament Speaker İsmail Kahraman, former President Abdullah Gul and former Prime Minister Ahmet Davutoglu.

Earlier in the day, Erdogan attended the funerals of other victims in Fatih mosque.

At least 2,839 pro-coup members of the military, including 29 colonels and over 40 generals, were detained across Turkey.

Turkey's top judicial body HSYK also ordered the detention of 2,745 Gulen-linked judges and prosecutors on Saturday while two members of the Constitutional Court were detained for involvement in the coup attempt.

As a result of the attempted coup, 161 people were killed, including 41 police officers and 47 civilians, while 1,440 others were injured and some 104 pro-coup figures were also killed.

Source: Daily Sabah