Istanbul — There is no doubt in the mind of Aisha Özkan Kale about where Turkey is headed – and about the wisdom of the man who is leading Turks there.

Every night since the failed coup of July 15, the English teacher and her family have heeded the call from President Recep Tayyip Erdoğan to “not leave the squares empty” in a people-power show of force.

The words “freedom” and “democracy” ring out constantly; the anti-coup events are dominated by the ruling Islamist-rooted Justice and Development Party (AKP) – and by pumping techno songs repeating “Er-do-ğan!” again and again. But one of the largest crowds at Istanbul’s Taksim Square was a unity rally for all factions organized by Turkey’s main secular opposition party, which has battled Erdoğan and the AKP for years.

“This is a democracy meeting, we are all together,” says Mrs. Kale, impressed by the massive turnout in a society deeply divided over religion and politics. “All these people agree that the government will be stronger, our president, Recep Tayyip Erdoğan, will be stronger. In this situation, they stand by democracy.”

Mr. Erdogan faces a critical turning point in Turkish history as he negotiates the aftermath of the coup attempt. When he took power in 2002, he was known as a humble Islamic populist who had served as Istanbul’s mayor, only to be banned from office in 1998 and sentenced to prison for too overtly inserting religion into politics. Fourteen years later, his power is near absolute, Islam has gained influence in political and social life, and Erdoğan’s sultan-like image is reinforced by the 1,000-room, $350 million presidential palace he had built for himself.

The question many Turks are now asking: Will Erdoğan use his enhanced, street-fed mandate – carefully curated since his loyalists risked and lost their lives to stop tanks and disarm soldiers – to heal divisions and build on this rare political unity?

Or will he collect more power and exercise greater authoritarianism, deepening his divisive us-versus-them rhetoric while pursuing his long-prized dream of creating an all-powerful presidential system in Turkey?

How Erdoğan decides will be a key marker in the decades-long transformation from a man who warned in 1993 about “dictatorships formed in the name of democracy,” to today’s authoritarian winner-take-all style that lionizes democracy but has left many of those who did not vote for the AKP in the cold.

Experts say the specific reasons behind this shift are unclear, especially as it was pragmatic problem-solving that marked the AKP’s first years in power and brought unprecedented prosperity. Many are unsure whether an inclusive view of democratic values espoused by Erdoğan gave way to an exclusionary, majoritarian vision over time – or was there from the start.

But for Kale, who wears a bright purple headscarf and designer sunglasses, there is only one priority.

“In every society there will be divisions,” she says, when asked about Turkey’s cleavage between secular and devout. “This is not a time of being enemies with each other. It’s a time of being together. We all pray for this.”

That unity held this week, as Erdoğan met with leaders of Turkey’s two main secular opposition parties. They agreed to “normalize” political relations and to amend the Constitution. A senior official says that, “as a sign of his appreciation,” Erdoğan “is considering” withdrawing all lawsuits he had filed with the aim of reining in opposition leaders.

But there are also signs of rancor, as a sweeping purge affects more than 60,000 soldiers, policemen, judges, prosecutors, educators, and even journalists, all accused of links to Fethullah Gülen, a cleric and ally-turned-foe of Erdoğan who now lives in exile in Pennsylvania. On July 27, Turkey announced that 149 generals and admirals had been “dishonorably discharged” – nearly half of the top brass of the NATO member – along with 1,099 other senior officers. Overall, 18,044 have been detained at some point, with 8,113 of those arrested.

At the unity rally, the Republican People’s Party (CHP) chief warned against wielding state power with “the fury of prejudice,” and called for a clear separation of powers. Yet crucial to the president’s vision for 2023 – the 100th anniversary of the founding of the Turkish Republic and a milestone often cited by the AKP – is an Ottoman-style, elevated presidency.

It’s an ambition that the failed coup has only made more urgent – but one that reflects an Erdoğan and AKP that have changed significantly since the party won its first landslide victory in 2002.

“Yes, [Erdoğan] is moving to a presidential system. But the guy who’s moving to the presidential system is not the guy who was there at the beginning,” says a veteran Turkish analyst, who asked not to be named for fear of consequences of appearing critical.

“It’s a transformation of the man, a transformation of the party as an instrument of his will, a transformation of the country in which there’s much less tolerance, into one even more polarized,” says the analyst.

The path to the current moment has been long.

The Welfare Party, which Erdoğan led, was forced from power in 1997 by a powerful military that traditionally cast itself as protector of the secular state. Three military coups had previously been conducted since 1960.

But the AKP that emerged in 2001 from the ashes of the Welfare Party was a reformed and moderately Islamic force, committed more to business and building infrastructure than to imposing overt religion on politics and society.

During Erdoğan’s 12 years as prime minister to 2014, the AKP won increasingly large mandates, finally reaching nearly 50 percent of the vote. But Erdoğan has made no secret of his desire to transform Turkey’s once-symbolic presidential post – a move many saw as a move toward becoming a modern-day sultan, but which Erdogan said firmly earlier in his career would not concentrate all power in the hands of a single person.

And yet many note that Erdoğan’s demeanor has become more abrasive, and his tone more divisive, as challenges to his rule persist.

By all accounts, Erdoğan was shaken by that unrest, and stepped up divisive rhetoric. Police cracked down, firing tens of thousands of tear gas canisters in the course of several weeks at fellow Turks – most of them secular – who Erdoğan derided as “terrorists” and “marauders,” traitors who failed at the ballot box and were defiling “our mosques.”

“Right now with difficulty, we are restraining at least 50 percent [who support us] in their homes,” Erdoğan warned the thousands of Gezi Park protesters. “We are saying to them, ‘For goodness sake, be patient, be calm, don’t come to these games.”

Last week, buoyed by the street rallies of his supporters, Erdoğan vowed to renew Gezi development plans, “whether they like it or not.”

“There are now two ways for Erdoğan,” says a secular architect at the unity rally. “If he takes more power, I am not in favor. He also has a chance to increase unity.”

Asked about the “whether they like it or not” statement, he says: “If you give power to someone, and see all these people behind you, maybe you think this way.”

Yet in pushing for a stronger presidency, Erdoğan also argues that the principles of national will and democracy “are much better understood today” than at the founding of the republic in 1923, and will protect against authoritarianism. Unity among Turks post-coup attempt, said Erdoğan, is the “clearest evidence” that the future of Turkey’s democracy will see the “greatest advancement of freedom and development.”

Not all are convinced.

“Today I see here barbarians, a very rude crowd,” says Serkan, a CHP member, speaking in hushed tones at the unity rally. “I see a Turkey that has double polarization, a big faultline between religious people and secular. The first night [of the coup attempt], we feared civil war. Now it’s still possible.”

Analyst Soner Cagaptay suggests that Erdoğan’s past incremental style may be tested by the “eruption of Islamic support for him” after the coup attempt. “This is Turkey’s Iran 1979 moment – will a brewing Islamic revolution overwhelm the force of secularism?” says Mr. Cagaptay, a Turkey expert at the Washington Institute for Near East Policy, in a Wall Street Journal opinion piece.

Relying on the street because he can’t rely on the military or police presents it own dangers, says the unnamed Turkish analyst.

“What happens is a symbiotic relationship between you and the crowd [such that] your ability to do some of the things you used to do as a very pragmatic politician, which [Erdoğan] used to be, is constrained,” says the analyst.

“After having promised so much, this is where we are,” says the analyst. “For protection he is relying on the street, and by definition is pushing it towards populism and towards xenophobia.”