In December 2002 at the White House, President George W. Bush greeted an up-and-coming politician from Turkey whose newly formed party had just won a surprising majority in parliament.
“Welcome to the home of one of your country’s best friends and allies,” Mr. Bush told the politician, Recep Tayyip Erdogan. “You are a strategic ally and friend of the United States.”
Two months later, Mr. Erdogan became prime minister, rocketing him to the top of Turkey’s political system and kicking off his two-decade tenure as his country’s most powerful figure.
Turkey’s election on Sunday is in many ways a referendum on the dramatic changes that Mr. Erdogan has brought in 11 years as prime minister and nine as president. Once a new political force promising to clean up corruption, expand the economy and strengthen ties with the West, he is now a nearly all-powerful leader, blamed for Turkey’s sinking currency and criticized for undermining democracy.
Mr. Erdogan, 69, grew up poor in a tough neighborhood in Istanbul, Turkey’s largest city, where his father was a ferry captain. He studied at Islamic schools usually intended for future clerics but went into politics and won a four-year term as Istanbul’s mayor in 1994. Residents credited him with cleaning up the ancient, messy metropolis.
In 1997, he was removed from office and sentenced to 10 months in prison for inciting violence after he recited an Islamist poem at a rally. He ended up serving only four months but received a longer ban from politics.
When his Justice and Development Party, which he had helped found, won its unexpected parliamentary majority in 2002, it was the strongest showing to date by an Islamist political group in Turkey’s staunchly secular political system. The next year, Mr. Erdogan’s political ban ended and he became prime minister.
For about a decade, he and his party delivered on their promises of good governance and economic growth. Turkey’s gross domestic product more than tripled, lifting millions out of poverty, and new airports, hospitals, highways and bridges sprung up across the country.
Internationally, Mr. Erdogan was lauded as an Islamist and pro-business democrat who could serve as a bridge between the West and the Muslim world.
But challenges arose. In 2013, protests against a construction project Mr. Erdogan had backed on the site of an Istanbul park escalated into mass anti-government demonstrations. Fearing instability, some foreign investors began withdrawing their capital.
In 2016, two years after he became president, Mr. Erdogan survived a coup attempt that included a failed effort to kidnap him from a seaside resort. He responded by further centralizing power and sidelining critics — purging tens of thousands from the judiciary and state bureaucracy and replacing many of them with loyalists, restricting civil liberties and increasing his influence over the news media.
In 2017, he pushed for a constitutional referendum that ended Turkey’s parliamentary system and transferred much of the state’s power to the president, meaning him.
All along, he and his party remained formidable at the ballot box, and used their electoral mandate to promote a religiously conservative outlook. Mr. Erdogan expanded Islamic education and loosened regulations aimed at ensuring a secular state, including lifting a ban on head scarves for women in government jobs.
Many of his voters, who tended to be rural, devout and working class, looked to him as their defender from a secular elite that they felt looked down on them.
But Mr. Erdogan’s honeymoon with the West, especially the United States, didn’t last. He accused Washington of complicity in the attempted coup because the cleric he accused of cooking up the plot lives in Pennsylvania, an accusation the cleric denies.
After Mr. Bush, Presidents Obama and Trump both welcomed Mr. Erdogan in the White House, but President Biden has not. And on Saturday, the last day of campaigning, Mr. Erdogan accused Mr. Biden of working with Turkey’s political opposition to unseat him.