Erdoğan was a semi-professional footballer playing for Kasımpaşa before being elected as the Mayor of Istanbul from the Islamist Welfare Party in 1994. He was stripped and banned from office and imprisoned for 4 months for the recitation of a poem in a political speech in 1998 after which he abandoned openly Islamist politics and established the moderate conservative AKP in 2001. The AKP won a landslide victory in the 2002 general election, with the party's co-founder Abdullah Gül becoming Prime Minister until his government annulled Erdoğan's ban from political office. Erdoğan subsequently became Prime Minister in March 2003 after winning a seat in a by-election held in Siirt.
As part of his 2023 vision for the centenary of the Turkish Republic, Erdoğan's government oversaw accession negotiations for Turkey's membership of the European Union, an economic recovery following a financial crash in 2001, two successful constitutional referendums in 2007 and 2010, a Solution process with Kurdish militants, an allegedly Neo-Ottoman foreign policy and investments in infrastructure that included new roads, airports and a high-speed train network. With the help of Fethullah Gülen's Cemaat Movement, Erdoğan was able to curb the political power of the military through the controversial Sledgehammer and Ergenekon court cases. In late 2012, his government began peace negotiations with the Kurdistan Workers Party (PKK) to end the ongoing PKK insurgency that began in 1978. The ceasefire broke down in 2015, leading to a renewed escalation in conflict. In 2016, a coup d'état was unsuccessfully attempted against Erdoğan and Turkish state institutions. This was followed by purges.
Nationwide protests against the perceived authoritarianism of Erdoğan's government began in May 2013, with the internationally criticised police crackdown resulting in 22 deaths and the stalling of EU membership negotiations. Following a split with long-time ally Fethullah Gülen, Erdoğan brought about large-scale judicial reforms that were criticised for threatening judicial independence, but which Erdoğan insisted were necessary to purge sympathisers of the preacher Fethullah Gulen. A US$100 billion government corruption scandal in 2013 led to the arrests of Erdoğan's close allies, with Erdoğan himself incriminated after a recording was released on social media. Erdoğan's government has since come under fire for alleged human rights violations and crackdown on press and social media, having blocked access to Twitter, Facebook and YouTube on numerous occasions. Erdoğan's government lifted the bans upon court orders. Opposition journalists and politicians have criticised authoritarian tendencies. Analysts suggest that Turkey is a majoritarian democracy. Erdoğan's proponents suggest that since the attempted coup, press restrictions are changing, Erdoğan's government dropped charges against the secular Dogan Group, including Hurriyet paper after it was alleged that the $4.5 billion tax fraud charge was initially perpetrated by Gulenist officers. In the aftermath of the coup attempt, Erdoğan issued a Presidential pardon against those who 'insulted' him. Erdoğan aims to bring the executive Presidency to a referendum in 2017, with a bill likely to pass parliament due to agreement between Erdoğan's conservative AKP and the nationalist MHP.