Turkey's ruling Justice and Development Party (AK Party) lost its parliamentary majority in Sunday's closely-fought elections, bringing down the curtain on 13 years of single-party rule.
Here are key events in the party's history since it first came to power in 2002.
2002: The AK Party scores its first electoral victory after years of political instability and an unprecedented financial crisis. The victory sets off alarm bells among the secular establishment that fears the Islamic roots of AK Party members.
2003: Recep Tayyip Erdoğan takes over from his close ally Abdullah Gül as prime minister.
2004: The AK Party, which wants to start accession talks with the European Union, launches a massive range of democratic reforms, such as allowing Kurdish language broadcasts on public television.
2005: Negotiations between Turkey and the EU formally begin. The process remains stalled owing to disputes over the divided island of Cyprus and the reluctance of many European countries to welcome a Muslim-majority nation of 75 million people.
2007: In the spring, a political crisis erupts surrounding the election of a new president after the AK Party announces that foreign minister Gül is its candidate. The army cites concerns over secularism, triggering early elections.
In July the AK Party wins the legislative vote. Erdoğan remains prime minister and a month later, parliament elects Gül as president. The government progressively brings the army to heel.
2008: The AK Party initiates a constitutional amendment to lift the ban on the Islamic headscarf at universities. Deemed anti-secular, it is negated by the constitutional court which sought a political ban on the AK Party, which itself narrowly escapes a dissolution by court order. The headscarf ban is progressively eased from 2010.
2011: In June, the AK Party wins its third consecutive election victory. Erdoğan begins a third term as prime minister, the last mandate according to AK Party rules.
2012: On June 22 Syria shoots down a Turkish fighter jet. Other incidents follow. Ankara had broken off relations with the Damascus regime since the start of the conflict there in March 2011, admitting Syrian refugees who number almost two million in 2015.
2013: In March, the leader of the outlawed Kurdistan Workers' Party (PKK), Abdullah Öcalan, announces a ceasefire. The level of unrest has fallen dramatically in recent years as the government seeks a final peace deal with the PKK.
In May, a group of people demonstrate against government plans to redevelop a park near Istanbul's Taksim square. The protest quickly grows into wider nationwide demonstrations against Erdoğan, leaving eight dead and thousands injured after clashes.
In November, a feud emerges between Erdoğan and Fethullah Gülen, the leader of the Gülen Movement who is on a self-imposed exile in the United States. Gülen Movement is seen as a national threat by the Turkish state for attempts to over throw the government.
2014: The authorities retaliate by arresting thousands of police and prosecutors believed to be linked to Gülen and introducing curbs on the judiciary and the Internet.
The AK Party wins key local elections in March and in August Erdoğan wins the presidential election.
2015: The AK Party wins the most votes in closely-fought legislative elections on June 7, but loses its parliamentary majority and will need to form a coalition.