In the 1994 election as the candidate of the Islamist Welfare Party, he was elected Mayor of Istanbul. He was later stripped of his position, banned from political office, and imprisoned for four months for inciting religious hatred, due to his recitation of a poem by Ziya Gökalp. Erdoğan subsequently abandoned openly Islamist politics, establishing the moderate conservative AKP in 2001, which he went on to lead to a landslide victory in 2002. With Erdoğan still technically prohibited from holding office, the AKP's co-founder, Abdullah Gül, instead became Prime Minister, and later annulled Erdoğan's political ban. After winning a by-election in Siirt in 2003, Erdoğan replaced Gül as Prime Minister, with Gül instead becoming the AKP's candidate for the presidency. Erdoğan led the AKP to two more election victories in 2007 and 2011, before being elected President in 2014, and re-elected in 2018.