"First of all we will chop off the heads of those traitors," Erdogan told a rally in Istanbul, prompting cries from the crowds that capital punishment should be restored in Turkey.
Reaffirming previous comments, he vowed to sign any bill passed by parliament to restore capital punishment in Turkey, a move that would effectively end Ankara's European Union membership ambitions.
"We are a state governed by rule of law. If it comes to me after parliament, I will sign it," he said.
"I spoke to the prime minister and... When they appear in court, let's make them appear in uniform suits like in Guantanamo," Erdogan said.
More From This Section
A controversy erupted last week when one suspect was seen going into court with the word "hero" in large letters in English on a T-shirt.
Erdogan was speaking to hundreds of thousands of supporters gathered at the bridge over the Bosphorus that saw some of the fiercest fighting on the night of the July 15, 2016 attempted coup.
He meanwhile lashed out at claims from the opposition that the government had foreknowledge of the coup and let it play out to its own advantage in a so-called "controlled" putsch.
"This is a shame, this is an immorality," Erdogan said. "This is a disrespect, an insult to our people," he added.