Turkey on Sunday voted in a momentous election that could extend President Recep Tayyip Erdogan's 21-year grip on power or put the mostly Muslim nation on a more secular course.
The presidential and parliamentary ballot has turned into a referendum on Turkey's longest-serving leader and his Islamic-rooted party.
It is also the toughest of more than a dozen that Erdogan has confronted -- one that polls suggest he might lose.
The 69-year-old has steered the nation of 85 million through one of its most transformative and divisive eras in the post-Ottoman state's 100-year history.
Turkey has grown into a military and geopolitical heavyweight that plays roles in conflicts stretching from Syria to Ukraine.
The NATO member's footprint in both Europe and the Middle East makes the election's outcome as critical for Washington and Brussels as it is for Damascus and Moscow.
But Erdogan's first decade of economic revival and warming relations with Europe was followed by a second one filled with social and political turmoil.
He responded to a failed 2016 coup attempt with sweeping purges that sent chills through Turkish society and made him an increasingly uncomfortable partner for the West.
The emergence of Kemal Kilicdaroglu and his six-party alliance -- a group that forms the type of broad-based coalition that Erdogan excelled at forging throughout his career -- gives foreign allies and Turkish voters a clear alternative.
Polls suggest the 74-year-old secular opposition leader is within touching distance of breaking the 50-percent threshold needed to win in the first round.
A runoff on May 28 could give Erdogan time to regroup and reframe the debate.
But he would still be hounded by Turkey's most dire economic crisis of his time in power and disquiet over his government's stuttering response to a February earthquake that claimed more than 50,000 lives.
'Can't see my future'
Kivanc Dal, an 18-year-old first-time voter, said economic woes would push him to back Kilicdaroglu. "I can't see my future," the university student told AFP in Istanbul on the eve of the vote.
Erdogan "can build as many tanks and weapons as he wants, but I have no respect for that as long as there is no penny in my pocket".
But kindergarten teacher Deniz Aydemir said Erdogan would get her vote, citing Turkey's social and economic development in recent decades and dismissing the idea that a six-party coalition could govern effectively.
"Yes, there are high prices... but at least there is prosperity," the 46-year-old said on Saturday.
Erdogan's campaign became increasingly tailored to his core supporters as election day neared.
He branded the opposition a "pro-LGBT" lobby that took orders from outlawed Kurdish militants and was bankrolled by the West.
Erdogan's ministers and pro-government media referred darkly to a Western "political coup" plot.
The opposition began to worry that Erdogan was scheming up ways to hold on to power at any cost.
The tensions boiled over when Istanbul's opposition Mayor Ekrem Imamoglu -- a sworn foe of Erdogan who could become Kilicdaroglu's vice president -- was pelted with rocks and bottles while touring Turkey's conservative heartland.
The opposition leader ended his campaign on Saturday by laying carnations at the mausoleum of Mustafa Kemal Ataturk -- a revered military commander who created the secular Turkish state.
Erdogan wrapped things up by leading prayers at Istanbul's iconic Hagia Sophia mosque, a characteristic flourish that openly defied his critics and paid homage to his most fervent followers.
The Hagia Sophia was built as a Byzantine cathedral -- once the world's largest -- before being transformed into a mosque by the Ottomans.
It was turned into a museum as part of the modern republic's efforts to remove religion from public life.
Erdogan's decision to reconvert it into a mosque in 2020 solidified his hero status among his religious supporters and contributed to growing Western unease with his rule.
The election is expected to feature heavy turnout among the country's 64 million registered voters.
The last national election saw Erdogan win 52.5 percent on a turnout of more than 86 percent.
Turkey has no exit polls but tends to count ballots quickly.
Polling stations close at 5:00 pm (1400 GMT) and all reporting restrictions are lifted four hours later. The first results are sometimes published before then.
Voters will also select a new 600-seat parliament.
Polls suggest that Erdogan's right-wing alliance is edging out the opposition bloc in the parliamentary ballot.
But the opposition would win a majority if it secured support from a new leftist alliance that represents the Kurdish vote.