Turkish officials continue to detain people they say played a part in or supported the July 15 failed military coup attempt, as President Recep Tayyip Erdogan pledged that the "cleansing" will continue.

Speaking at a funeral in Istanbul on July 17, Erdogan vowed to "clean all state institutions of the virus" of supporters of U.S.-based cleric Fethullah Gulen, whom Ankara blames for being behind the plot to overthrow the government.

Erdogan attended a late-night rally in the capital, Ankara, where thousands of flag-waving people came out to listen to him and Prime Minister Binali Yildirim speak.

Turkey said on July 17 that it would request the extradition of Gulen, who has condemned the failed coup attempt and denied any involvement in it.

U.S. Secretary of State John Kerry said he had spoken to Turkish Foreign Minister three times in recent days and told him that Washington would consider a formal extradition request for Gulen but would only comply if Turkey showed compelling evidence of Gulen's involvement in the coup attempt.

Erdogan urged his supporters to continue to occupy public places and take to the streets in the days ahead to show support for his government.

A large late-night rally was also held in Istanbul's central Taksim Square and in the coastal cities of Izmir and Antalya.

The more than 6,000 detentions and dismissals that have been made so far include high-ranking military officers and some 2,700 judges. More than 50 senior officers were detained on July 17.

Justice Minister Bekir Bozdag described the arrests as a “clean-up operation,” saying the number is expected to rise.

Officials also raised the death toll from the coup attempt to 294 people as dozens of funerals were held on July 17.

Erdogan attended the funeral of his campaign manager, Erol Olcak, and his 16-year old son, who were killed by renegade soldiers at the Bosphorus Bridge on July 15.

The president vowed to move the country forward in "unity and solidarity."

Erdogan also said that Turkey could reinstate the death penalty, which it abolished in 2004.

He promised a crowd on July 17 that there would be talks in parliament about bringing back capital punishment because "those who attempt a coup in this country must pay."

Meanwhile, U.S. defense officials announced that Turkey had reopened its airspace to military aircraft at the Incirlik Air Base, used by the U.S.-led coalition for air operations against Islamist groups in Syria and Iraq.

Prime Minister Yildirim said on July 17 that life has returned back to normal following the turmoil in Istanbul and the capital, Ankara.

He said the central bank, capital markets board, banking system, and stock exchange were all operating on their normal schedules.

In Athens, eight Turkish soldiers who flew a helicopter to Greece during the coup attempt and asked for political asylum are due to appear in court on July 18.

Turkish officials have demanded that they be sent back to Turkey.

And in Saudi Arabia, officials arrested the Turkish military attache to Kuwait at the Riyadh airport on instructions from Ankara for his alleged involvement in the coup attempt.