Nearly 250 people were killed, excluding coup-plotter and over 2,000 others were injured after a rogue military faction tried to wrest power from the president, but thousands took to the streets in response to Erdogan's call to defeat the uprising.
This third anniversary comes at a difficult moment for Erdogan, faced with a weakened economy, worsening relations with NATO ally the United States, and a defeat for his party in the recent Istanbul mayoral election to a more unified opposition.
Turkey marks coup defeat with rallies, Erdogan warning to 'traitors'
Erdogan will take part in a series of events in the capital Ankara before giving a speech in Istanbul and inaugurating a museum dedicated to the failed coup on July 15, 2016.
After laying flowers at a special monument for the coup victims in Ankara at his presidential palace complex, Erdogan took part in a ceremony at the parliament, which was also bombed during the attempted putsch.
The day, known as "15 July" in Turkish, has become a national holiday in Turkey.
Ankara accuses former ally-turned-foe Fethullah Gulen, a Muslim cleric exiled in the United States, of ordering the attempted coup and his movement of being a "terrorist" organisation.
Since 2016, tens of thousands of people have been detained while 150,000 public sector employees have been suspended or sacked over alleged links to Gulen.
There are still almost daily police raids to capture dozens of suspects accused of ties to Gulen as part of different investigations by public prosecutors across Turkey.
Gulen, based in Pennsylvania, strongly denies Ankara's claims and the movement denies it is a terror group, saying it promotes education and moderate Islam.
Bylock: shadowy app Turkey says was key to coup bid
Relations with the West deteriorated after the failed coup as Turkish officials accused Western countries of not being supportive enough of Ankara.
Simultaneously, Erdogan has grown ever closer to Russian President Vladimir Putin since 2016, raising concerns in Europe and the US over Turkey's move towards Moscow.
The latest issues causing tension with the West involve Ankara's purchase of the Russian S-400 missile defence system, which was partly delivered last week, as well as Turkish drilling for gas and oil off Cyprus despite EU warnings against such action.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ