In power since 2002, Erdogan has now taken part in 14 elections including two presidential votes, and won them all.

Turkey’s President Recep Tayyip Erdogan overcame the toughest challenge of his 15-year rule with a victory in the high-stakes snap elections that will give him sweeping new powers to lead the country.

The Supreme Election Council (YSK) declared Erdogan the winner early on Monday, hours after he declared victory based on unofficial results.

For Erdogan, installing an executive presidency has been his years-long ambition and he staked his career on it by calling the elections 18 months early.

Erdogan has overseen historic change in Turkey since his ruling party first came to power in 2002 after years of secular domination. But critics have accused him of trampling on civil liberties and of autocratic behaviour.

The president has for the last two years ruled under a state of emergency imposed in the wake of the 2016 failed coup, with tens of thousands arrested in an unprecedented crackdown, which cranked up tensions with the West.

Erdogan has never lost an election and has been in power since 2003, initially as prime minister, then as president from 2014.

At 64, Erdogan has in his political career overcome a stint in prison, mass protests and even a bloody coup attempt to emerge as Turkey’s uncontested leader.

He has freed up constraints on religion in the officially secular but overwhelmingly Muslim state, overseen a vast programme of infrastructure building he calls his “crazy projects” and implemented a more assertive foreign policy.

For supporters, Erdogan gives a voice to Turkey’s Muslim majority, has brought new levels of economic prosperity and commands respect on the international stage.

But detractors argue that Erdogan is taking Turkey on a dangerous path to authoritarianism reminiscent of the Ottoman Sultans.

Political rise

Erdogan’s AK Party was formed by a breakaway group of the Virtue Party, which was shut down by the courts in 2001 due to its “anti-secular” activities.

Erdogan was born in 1954, the son of a coastguard from the city of Rize on Turkey’s Black Sea coast.

He was 13 when his father decided to move to Istanbul, in the hope of giving his five children a better upbringing.

As a teenager, he sold lemonade and sesame buns (simit) on the streets of Istanbul’s rougher districts to earn extra money.

He attended an Islamic school before obtaining a degree in management from Istanbul’s Marmara University in 1981 – and playing professional football.

While at university, he met Necmettin Erbakan – who went on to become the country’s first Islamist prime minister.

Erdogan entered politics at a very young age. During high school in the early 1970s, he was elected chairman of the National Salvation Party Istanbul Youth Organisation.

After the 1980 military coup, Erdogan followed most of Erbakan’s followers into the Welfare Party. He became a district chair in 1984 before advancing to chair of the Istanbul city branch. He was elected to parliament in 1991, but barred from taking his seat.

During his tenure, he developed a new organisational structure for the Istanbul Branch, which became a model for other political parties.

One of his most important initiatives, while serving in Istanbul Branch, was strengthening female participation in politics. This successful structure was credited with placing the Welfare Party in the first place in subsequent elections.

Supporters of Erdogan and his AK Party celebrate in Ankara following the president’s victory [AFP]

Erdogan’s political rise within the Welfare Party continued in 1994, when he became the mayor of Istanbul.

Many feared he would impose Islamic law. However, he proved to be pragmatic in office as mayor.

Imprisonment as mayor

Although his critics admitted that he helped make Istanbul cleaner and greener, a decision to ban alcohol in city cafes angered secularists.

He also won admiration from the many who felt he was not corrupt – unlike many other Turkish politicians.

His background and commitment to Islamic values also appealed to devout Muslim Turks.

However, he was given a 10-month prison sentence (of which he served four) for reading an Islamic poem in Siirt in December 1997.

The poem included the lines, “The mosques are our barracks, the domes our helmets, the minarets our bayonets and the faithful our soldiers…” and was considered a violation of Kemalism by the secular judiciary.

With the conviction, Erdogan was forced to give up his mayoral position. The conviction also stipulated a political ban, which prevented him from participating in parliamentary elections.

The AK Party won the 2002 elections under Erdogan’s leadership, and consolidated its political dominance in local elections in 2004, becoming the biggest party in 12 out of 16 metropolitan municipalities.

Undefeated

In 2007, the party won again in parliamentary elections, but its share of the vote slipped to 39 per cent in 2009 local elections, attributed by analysts to a dip in Turkey’s economic fortunes during the global economic crisis.

In 2011, Erdogan’s party won 327 seats in parliament, and picked him as prime minister making him the only prime minister to win in three consecutive elections.

In 2014, he was elected as president before seeking another term in office with more expanded powers this year.

Known to his inner circle as “beyefendi” (sir) and to admirers as “reis” (the chief), Erdogan prides himself on being able to woo doubters with his indefatigable campaigning.

His only setback – so far – came in June 2015 elections when the AK Party won the most votes but lost its overall majority for the first time.

But Erdogan swatted away the prospect of a coalition, saying such governments belonged to the days of “old Turkey”. He called new elections in November 2015 where the party’s majority was restored.

Erdogan pressed on with an April 2017 referendum on a new constitution that abolishes the office of prime minister and that critics said resembled an autocracy, but eked out a relatively narrow win.

In one and a half decades since his ruling party came to power, Erdogan has now taken part in 14 elections – six legislative polls, three referenda, three local elections and two presidential votes – and won them all.

“Now is the time to work, set aside the tensions from the election period and focus on the country’s future,” Erdogan declared in his victory speech after he was re-elected.