Mr Erdogan also said Turkey could consider reinstating the death penalty following the putsch bid, despite concerns in the international community.
World leaders including US President Barack Obama have strongly condemned Friday’s (July 15) attempted takeover by an army faction, but there is also alarm over the retaliatory purges, especially after pictures emerged showing the rough treatment of some suspects.
Justice Minister Bekir Bozdag said around 6,000 people had been detained in “clean-up operations” and warned that the number would rise.
They include senior army commanders, top judges, prosecutors and a military aide to Mr Erdogan.
A resurgent Mr Erdogan raised the prospect of bringing back capital punishment, which was abolished in 2004 as the country sought to improve its chances of joining the EU.
“In democracies, decisions are made based on what the people say. I think our government will speak with the opposition and come to a decision,” he said, reacting to crowds in Istanbul calling for the death penalty.
“We cannot delay this any more because in this country, those who launch a coup will have to pay the price for it,” he told supporters.
Earlier he told a crowd of thousands at a funeral for the victims in Istanbul there would be no let-up in the fight against his sworn enemy Fethullah Gulen, the US-based Islamic preacher he accuses of masterminding the coup plot.
“We will continue to clean the virus from all state bodies because this virus has spread. Unfortunately like a cancer, this virus has enveloped the state,” he said.
A total of 265 people were killed during the coup bid, including 161 civilians and regular troops and 104 coup plotters, according to government and military figures.
Clashes erupted at an air base in the central city of Konya between security forces and putschists trying to evade arrest, while at Istanbul’s second airport Sabiha Gokcen, police fired warning shots at rebel troops who later surrendered, a Turkish official said.
Turkish authorities have made clear they will show no mercy in the wake of the coup, which sparked fears of chaos in the strategic NATO country of 80 million people.
It was the biggest challenge to Mr Erdogan’s rule in his 13 years as prime minister and president.
The group behind the putsch, which called itself the Council for Peace in the Homeland, said it was necessary to stop the increasingly authoritarian president from undermining Turkish democracy.
Critics at home and abroad had voiced mounting concern over the state of democracy and freedom of speech under Mr Erdogan.
But the 62-year-old leader successfully mobilised supporters into the streets to face down the plotters.
Thousands again responded late Saturday (July 16) to Mr Erdogan’s call to pour into the streets and celebrate the “victory of democracy”, with mass rallies of flag-waving Turks in cities including Ankara, Istanbul and Izmir.
“They may have tanks but we have our faith. We will not leave the squares... but we will continue defiantly,” said Mr Erdogan.
Turkish television has shown images of captured suspects forced to lie face down on the tarmac after their arrest while media photographers have seen suspects roughly led away, pursued by angry mobs.
NTV television said 34 generals of various grades had been detained so far.
Air force brigadier general Bekir Ercan Van was also detained at the key Incirlik air base used by US forces for raids in Syria, along with a dozen lower-ranked officers.
But the crackdown is not restricted to the military, and Anadolu said warrants have been issued for 2,745 judges and prosecutors.
Turkey shut down airspace around Incirlik after the coup, forcing the US to halt its strikes in Syria. But Pentagon spokesman Peter Cook said yesterday that operations against the Islamic State group had resumed from the base.
The putsch added to the turmoil in Turkey after a wave of deadly bombings blamed on IS jihadists and Kurdish rebels.
Mr Erdogan has long accused Mr Gulen of running a “parallel state” in Turkey, and called on Mr Obama to extradite the reclusive preacher from the United States to face justice.
Labour Minister Suleyman Soylu went even further, saying “the United States is behind the coup” and adding it had to hand over Mr Gulen.
The 75-year-old preacher has categorically denied any involvement in the plot and suggested it could have been staged by Mr Erdogan himself.
Mr Obama meanwhile told Turkey there is a “vital need” for all parties to “act within the rule of law”.
And French Foreign Minister Jean-Marc Ayrault warned Mr Erdogan against using the failed putsch as a “blank cheque” to silence his opponents.
But there was no such concern from Russian President Vladimir Putin, who called Mr Erdogan to wish for a “speedy restoration of strong constitutional order”.
Turkey has also demanded the extradition of eight people thought to have been involved in the putsch who landed in a Black Hawk military helicopter in Greece.