Gokcek is the fifth elected mayor from Erdogan's party to leave office under pressure from the president. Erdogan has said he wants to "rejuvenate" his party and replace officials he claims suffer from "fatigue." The mayor of Istanbul resigned last month.
The 69-year-old Gokcek has led Ankara since 1994 and frequently courted controversy. Earlier this year, he suggested that Turkey's enemies have triggered earthquakes to harm the country's economy. He also has claimed that a U.S.-based cleric the government blame for a July 2016 coup attempt controls his followers with genies.