Turkey headed for a runoff vote after President Tayyip Erdogan led over his opposition rival Kemal Kilicdaroglu in Sunday's election but fell short of an outright majority to extend his 20-year rule of the NATO-member country.
Here are some of the milestones in the career of a politician who has transformed Turkey over two decades, steering its traditionally secular society towards his Islamist vision, establishing the country as a regional military power and using the courts to crack down on dissent:
March 1994: Erdogan is elected Istanbul mayor as part of the Welfare Party, led by Islamist politician Necmettin Erbakan.
April 1998: Erdogan resigns as mayor after a court sentences him to prison for inciting religious discrimination over a poem he recited in 1997 comparing mosques to barracks, minarets to bayonets and the faithful to an army. He is jailed from March 1999 to July 1999.
August 2001: He establishes the Justice and Development Party, or AK Party (AKP), and is elected chairman.
November 2002: The AKP wins elections with nearly 35% of votes after the worst economic slump since the 1970s, promising to break with past mismanagement and recessions. Erdogan is legally barred from serving as prime minister due to his earlier conviction - but that decision is overturned in December.
May 2003: Erdogan becomes prime minister, beginning a decade of strong economic growth and rising living standards driven by an infrastructure boom and foreign investment. Erdogan tours Western capitals to promote his policies and advance Turkey's bid to join the European Union.
October 2007: In a referendum, Turks approve constitutional changes to allow the president - then a largely symbolic role - to be publicly elected.
February 2008: Parliament passes an amendment drafted by the AKP and the Nationalist Movement Party (MHP) that lifts a ban on wearing head scarves on university campuses.
The following month, the Constitutional Court hears a case over the separation of religion and state, and narrowly rules against dismantling the AKP and banning Erdogan and dozens of other party members from politics for five years.
September 2010: In another referendum, Turks approve judicial and economic amendments championed by Erdogan that are meant to align the constitution with EU standards even as Turkey's EU membership bid stalls over issues including the divided island of Cyprus, which Turkey invaded in 1974.
May 2013: Protests against Erdogan's plans to redevelop Istanbul's Gezi Park accelerate into unprecedented nationwide demonstrations over what critics see as his authoritarianism. Erdogan describes the protesters as thugs and vandals.
December 2013: Erdogan faces a sprawling corruption investigation involving senior officials, cabinet members and the head of a state-owned bank. He calls it a "judicial coup" organised by Fethullah Gulen, a U.S.-based Muslim cleric who had been an ally before a power struggle prompted a falling out.
August 2014: Barred by AKP regulations from running for a fourth consecutive term as prime minister, Erdogan in August wins Turkey's first presidential elections and starts calling for a new constitution to enhance the head of state's powers.
June 2015: In a first, the AKP falls short of a parliamentary majority in an election. But after parties fail to form a coalition, it regains a majority in November snap polls.
July 2016: Rogue soldiers commandeer tanks and helicopters, attack state buildings and parliament, and kill more than 250 people in a failed coup attempt. Erdogan survives and says it was orchestrated by Gulen's network. It prompts a state of emergency including widespread arrests of alleged network members in the military, and in the private and public sectors. Rights groups and Western allies later raise concerns that Erdogan used the coup attempt as a pretext to quash dissent.
August 2016: Erdogan authorizes a major military offensive into Syria - Turkey's first big incursion into another country in decades - marking the first of four cross-border operations.
April 2017: A referendum approves an executive presidential system, giving sweeping powers to the presidency. Erdogan had campaigned hard for the changes that would alleviate what he called hindrances in parliamentary democracies.
June 2018: Erdogan wins snap presidential elections. The AKP and their nationalist MHP allies secure a parliamentary majority.
August 2018: A series of economic crises and sharp lira depreciations begins with a currency crisis sparked by heightened tensions with the United States and other Western countries, as well as by concerns over Erdogan's unorthodox economic views and influence on monetary policy.
March 2019: Nationwide municipal elections produce Erdogan's first electoral defeat in nearly two decades. Candidates from the opposition alliance of the Republican People's Party (CHP) and the IYI Party defeat AKP mayoral candidates in cities including Ankara and Istanbul.
February 2020: Turkey and Russia come to the brink of confrontation after dozens of Turkish soldiers are killed in airstrikes in Syria's Idlib region.
Angered by what it sees as a lack of Western support and fearing another wave of Syrian refugees, Ankara says it would no longer stop them trying to reach Europe, despite a 2016 deal which committed Turkey to keeping migrants on its territory.
December 2020: The United States imposes sanctions on Turkey and its defence industry over Ankara's purchase of Russian S-400 air defence systems, pushing ties to a new low.
2021: Turkey starts mending strained regional ties including with Armenia, Israel, Egypt and Saudi Arabia. It also ramps up sales of sophisticated drones to Ukraine and other countries.
December 2021: The economy suffers an even deeper currency crisis following a series of interest rate cuts. The lira hits all-time lows, inflation soars to its highest levels during Erdogan's rule, and his approval ratings sink.
July 2022: Turkish mediation, alongside the United Nations, helps secure a deal allowing a resumption of Ukraine's grain exports, five months after Russia's invasion started. Erdogan's role is seen as crucial thanks to his relationship with Russian President Vladimir Putin.
February 2023: Turkey suffers the deadliest earthquake in its modern history with more than 50,000 people killed in the southeast. People in the disaster zone complain of a slow response by the authorities, particularly in the first days, prompting criticism of the government. Erdogan acknowledges the response could have been faster and asked "people's forgiveness for the shortcomings occurred in the first days of the quake".
May 2023: Turkey votes in an election expected to be a tight race between Erdogan and his main challenger - Kemal Kilicdaroglu. Though his popularity has suffered due to a cost-of-living crisis, Erdogan wins more votes than his rival but falls short of the 50% threshold needed to win in the first round, teeing up a May 28 runoff.
(Reporting by Tuvan Gumrukcu and Huseyin Hayatsever; Editing by Jonathan Spicer, Tom Perry and Gareth Jones)