Demonstrators held a cross-party "Republic and Democracy" rally in Istanbul's central Taksim Square in a spirit of unity following the failed coup, in which at least 246 people were killed and more than 2,000 injured.
In a rare move, pro-government channels broadcast a live speech from the podium by main opposition leader Kemal Kilicdaroglu.
"This is a day to unite, a day to stand up against coups and dictatorial regimes, a day to let the voice of the people be heard," he said at the rally, organised by his secularist opposition CHP but also backed by the ruling Islamist-rooted AK Party and by other opposition groups.
"We are all together in Taksim today. Today is a day we made history all together."
Erdogan will probably try to capitalise on the large size of the crowd of all political persuasions to try and reassert full control over the country, a NATO ally and an important partner in the US-led fight against Islamic State.