In 2001, Erdogan established the Justice and Development Party (AKP). The elections of 2002 were the first elections in which Erdogan participated as a party leader. All parties previously elected to parliament failed to win enough votes to re-enter the parliament. The AKP won 34.3% of the national vote and formed the new government. Turkish stocks rose more than 7% on Monday morning. Politicians of the previous generation, such as Ecevit, Bahceli, Yilmaz and Ciller, resigned. The second largest party, the CHP, received 19.4% of the votes. The AKP won a landslide victory in the parliament, taking nearly two-thirds of the seats. Erdogan could not become Prime Minister as he was still banned from politics by the judiciary for his speech in Siirt. Gul became the Prime Minister instead. In December 2002, the Supreme Election Board canceled the general election results from Siirt due to voting irregularities and scheduled a new election for 9 February 2003. By this time, party leader Erdogan was able to run for parliament due to a legal change made possible by the opposition Republican People's Party. The AKP duly listed Erdogan as a candidate for the rescheduled election, which he won, becoming Prime Minister after Gul handed over the post.  On 14 April 2007, an estimated 300,000 people marched in Ankara to protest against the possible candidacy of Erdogan in the 2007 presidential election, afraid that if elected as President, he would alter the secular nature of the Turkish state. Erdogan announced on 24 April 2007 that the party had nominated Abdullah Gul as the AKP candidate in the presidential election. The protests continued over the next several weeks, with over one million people reported to have turned out at a 29 April rally in Istanbul, tens of thousands at separate protests on 4 May in Manisa and Canakkale, and one million in Izmir on 13 May.  The stage of the elections of 2007 was set for a fight for legitimacy in the eyes of voters between his government and the CHP. Erdogan used the event that took place during the ill-fated Presidential elections a few months earlier as a part of the general election campaign of his party. On 22 July 2007, the AKP won an important victory over the opposition, garnering 46.7% of the popular vote. 22 July elections marked only the second time in the Republic of Turkey's history whereby an incumbent governing party won an election by increasing its share of popular support. On 14 March 2008, Turkey's Chief Prosecutor asked the country's Constitutional Court to ban Erdogan's governing party. The party escaped a ban on 30 July 2008, a year after winning 46.7% of the vote in national elections, although judges did cut the party's public funding by 50%.  In the June 2011 elections, Erdogan's governing party won 327 seats (49.83% of the popular vote) making Erdogan the only prime minister in Turkey's history to win three consecutive general elections, each time receiving more votes than the previous election. The second party, the Republican People's Party (CHP), received 135 seats (25.94%), the nationalist MHP received 53 seats (13.01%), and the Independents received 35 seats (6.58%).

Answer this question "Was he elected?" by extracting the answer from the text above.
In the June 2011 elections, Erdogan's governing party won 327 seats (49.83% of the popular vote) making Erdogan the only prime minister