ISTANBUL — When President Recep Tayyip Erdogan called early elections two months ago, he seemed assured of victory. But as Sunday’s vote approaches, the man who has transformed Turkey over 15 years in power appears increasingly vulnerable.

The question will be, just how vulnerable is he?

The vote will be watched far beyond Turkey’s borders for what it will decide about the direction this country of 80 million — whether it continues down the path of populist authoritarianism with Mr. Erdogan, or takes a turn for democratic change.

A skillful politician with a fervent support base, Mr. Erdogan still leads in the polls. But dissatisfaction over a sudden downturn in the economy is spreading. So is alarm over Mr. Erdogan’s increasing authoritarianism, which, if he wins, will be given even freer rein under a newly strengthened presidency.

“A strong Turkey needs a strong leader,” Mr. Erdogan bellowed to the crowd of several hundred thousand in his final Istanbul campaign rally last Sunday. “May God let us continue on this path by becoming more powerful.”