Hundreds of thousands of Turkish voters turned out on to the streets and squares of Istanbul on Saturday for a final day of rallies ahead of crucial presidential and parliamentary elections taking place on Sunday.

In a remarkable display of his growing popularity, opposition candidate Muharrem İnce drew at least a million people to a rally in the Maltepe district of the city, where he urged voters to end 16 years of rule by President Recep Tayyip Erdoğan and his Justice and Development (AK) party.

“We will embrace everyone,” he said, as supporters in festive mood sang anthems and waved red-and-white Turkish flags. “Turkey’s hopes will be revived. This is going to be a united Turkey.”

İnce, the candidate of the secularist opposition party known as CHP, has emerged as the most charismatic challenger to Erdoğan, and may push the president into a second-round contest.

An affable physics teacher and veteran CHP MP from the city of Yalova, he has criss-crossed the country marshalling votes and seeking a united front against the incumbent. He has pledged to roll back presidential powers, restore the rule of law in Turkey and end prosecutions of dissidents and journalists.

But Erdoğan, 64, who has ruled the country since 2002, first as prime minister then as president, has persevered in his usual bombastic style, ending his campaign yesterday with no fewer than five rallies. In Istanbul’s Esenyurt district, he told tens of thousands of supporters Turkey would go on “to achieve what others cannot imagine”, if they re-elected him once again.

Erdoğan called snap elections in April, a year and a half ahead of schedule, despite repeated denials by his party that such a plan was under consideration. He said regional instability made early elections imperative. But critics said Erdoğan was hoping to preempt an economic slump that had already been hinted at with the collapse of the Turkish lira against the dollar and a widening foreign trade deficit, and to limit and weaken the possible field of rivals.

Whoever wins the presidential election will assume extraordinary new powers, narrowly approved in a referendum last year that was marred with allegations of fraud. Those include the ability to appoint the cabinet and unelected vice-presidents, as well as senior judges, the power to issue decrees with the force of law and with limited parliamentary oversight.

Facebook Twitter Pinterest The ‘affable physics teacher’ İnce has emerged as a charismatic and popular rival to the president. Photograph: Bulent Kilic/AFP/Getty Images

In the parliamentary race, the AK party has formed an alliance with the nationalist party, the MHP, led by the septuagenarian Devlet Bahçeli. It faces an opposition grand coalition that includes the secularists of the CHP, the nationalists of the Iyi party led by Meral Akşener, and the Saadet party’s Islamists. The pro-Kurdish HDP is running independently without being part of a coalition but has indicated it would back the opposition candidate that makes it to the second round against Erdoğan.

The result of this dynamic campaign has been a far more interesting race than predicted when the snap polls were called, and has raised the distinct possibility that Erdoğan’s AK party may lose its parliamentary majority, even if the president is still the favourite to win.

Public opinion polls are notoriously unreliable in Turkey. Nevertheless on average they appear to show Erdoğan securing a comfortable victory in the first round of the presidentials, but without an outright majority. A much tighter race is predicted between him and İnce in a second round on 8 July.

Erdoğan faces a varied and convincing line-up of opponents, but İnce has proved the most threatening. In a month and a half he held 107 rallies in 65 cities, a whirlwind campaign that energised an opposition movement that few predicted would mount a credible challenge against Erdoğan. Last week he drew crowds of hundreds of thousands in the secular bastion of İzmir and in the capital, Ankara. He promised to end the state of emergency in place since the 2016 coup attempt, to continue “without mercy” the fight against terror groups, and to “unite Turkey”.

İnce has broached many red lines for hardline secularists, visiting the imprisoned HDP leader Selahattin Demirtaş and demanding his release, as well as backing a parliamentary debate on resolving the Kurdish issue.

He has also signalled his own religious piety and is a regular attendant at weekly Friday prayers, in a nod to Erdoğan’s religious base that is suspicious of secularists. At the end of his rally yesterday, he brought his headscarfed mother onto the stage, to loud cheers from supporters bearing flags of Mustafa Kemal Atatürk, the secular founder of the republic who abolished the Islamic caliphate.

“Headscarf or not, man or woman, partisan or not, we will not discriminate against anyone,” he said. “You can wear your headscarf wherever you want.”

İnce has sought to position himself as a democrat and populist, vowing to close down the opulent presidential palace in Ankara and turn it into an education centre, to end the state of emergency within two days of his victory, to restore the independence of the judiciary and to continue with determination the fight against terror groups. In a nativist nod, he pledged to restore diplomatic relations with the regime of Bashar al-Assad in Syria, in order to pave the way for the return of Syrian refugees to their country. There are more than 3 million displaced Syrians in Turkey.Some will support Erdogan for his crushing of the separatist insurgency in the Kurdish region, and his success in pushing the militants away from the Turkish border with Syria. Others are unnerved by his alliance with nationalists and their hardline approach to the Kurdish issue, as well as his recent military foray into Syria’s Kurdish region of Afrin.

Hundreds of HDP cadres, including MPs and the former chiefs of the party, mayors and activists have been detained in a wide-ranging crackdown, and many Kurdish news outlets have been shut down in the interim.

Erdogan appears to be concerned over the loss of votes to the HDP. In a video recorded surreptitiously during a meeting with prospective voters, he urged them to do “special work” to limit the HDP’s performance, in what was interpreted by some as a call urging fraud or intimidation.

The assault on human rights has been a backdrop for much of Turkish politics over the last two years, since a traumatic coup attempt in 2016 in which 250 people were killed and more than 2,000 wounded. The government instituted a state of emergency and pursued members of the movement of Fethullah Gulen, an exiled preacher and former ally of Erdogan, whose followers are widely believed to have orchestrated the failed putsch.