Speaking at the Democracy and Martyrs' Rally in Istanbul's Yenikapi district, he said: “Our presence today upsets our enemies just like it did on the morning of July 16.
“On that night there were people who risked their lives to stop the coup and they filled the streets. History will remember the names of our martyrs… in golden letters.”
Erdogan said Turkey would now take a “path in solidarity” towards the future. "Gulenists [supporters of U.S.-based preacher Fetullah Gulen] didn't take the people into account... Night of the July 15 coup bid showed that this country cannot be undone," he said.
"We will make the whole world know what Fetullah Terrorist Organization [FETO] is," the president said.
About a possible reinstatement of the death penalty in Turkey for those involved in the defeated coup, Erdogan reiterated his stance that the decision would be left up to Turkish lawmakers in the parliament.
"Parliament is the authority that will decide on the death penalty. The next step will be clear after the parliament takes a decision. I will approve reinstating the death penalty if the parliament approves," Erdogan said, adding that the Turkish political parties should abide by the will of the people.
In his speech, the president also slammed Germany for preventing him from addressing a rally in the German city of Cologne via a video link last week where between 30,000 and 40,000 people gathered to denounce the coup attempt in Turkey.
"Where is democracy [in Germany]? They let those [PKK terrorists] in Qandil [a mountainous region in Iraq] broadcast via video conference…Let them feed the terrorists, they will hit them back like a boomerang," Erdogan said.
The president asked the people to extend their “democracy watch” rallies until Wednesday in the country. "Today is a comma [pause] in democracy rallies, we will end the rallies on Wednesday," he added.
Erdogan was the final speaker to address a crowd that police said numbered nearly five million people.
It was the first time the leaders of the Justice and Development (AK) Party, the Republican People’s Party (CHP) and the Nationalist Movement Party (MHP) had shared a platform.
Chief of General Staff Gen. Hulusi Akar and Turkey’s top cleric Mehmet Gormez also attended.
The Yenikapi event is the highlight of weeks of democracy rallies held in cities across the country since the defeated coup, which led to 240 deaths.
Turkey’s government has said the coup was organized by the followers of Fetullah Gulen, who has lived in self-imposed exile in the U.S. since 1999.