An independent outsider and a jailed media magnate will head to Tunisia’s presidential run-off after a rollercoaster, 26-candidate election, according to a polling firm.

The winner’s top task will be stabilising the country’s young democracy.

Official preliminary results are expected in the next couple of days from Sunday’s first-round voting in the Mediterranean country that unleashed the 2011 Arab Spring uprising.

A second-round vote is expected by October 13, the electoral commission chief said.

An electoral poster for Nabil Karoui
An electoral poster for Nabil Karoui (Hassene Dridi/AP)

The projections by polling agency Sigma Conseil showed a surprise top showing of 19.5% for independent Rais Saied, a constitutional law professor without a party.

Tycoon Nabil Karoui, jailed since last month on money laundering and tax evasion charges, was projected to win 15.5%.

His supporters declared victory, and his wife read a letter he wrote from jail in which he thanked them. She said his legal team is pushing for his release as soon as Monday.

The polling agency projected the candidate of moderate Islamist party Ennahdha, Abdelfattah Mourou, would come third, followed by defence minister Abdeldrim Zbidi and then prime minister Youssef Chahed, who had been considered a top contender.

Youssef Chahed
Youssef Chahed (Riadh Dridi/AP)

Mr Saied has no political background but picked up support among young voters with his straightforward, anti-system platform. Frustration with corruption has driven many voters, which might have increased the appeal of an outsider candidate.

Mr Karoui positioned himself as the candidate of the poor, using his TV network to raise money for charity. His arrest appears to have mobilised voters who feel wronged or sidelined in the Tunisian economy. He was allowed to remain in the race because he has not been convicted.

Both promised to fight unemployment, a key problem in Tunisia that also helped drive its Arab Spring revolution.

The electoral commission announced that the overall turnout was a relatively low 45%. If no candidate wins more than 50% of Sunday’s vote, the election goes to a second round. The date of the run-off will be announced once the final first-round results are declared.

The voting followed a noisy but brief campaign — 12 days — marked by backbiting and charges of corruption among the contenders. All vowed to boost the country’s flagging economy and protect it from further deadly attacks by Islamist extremists.

Tunisia is in many ways an exception in the Arab world, with its budding democracy lurching forward despite the challenges. Some 6,000 Tunisian and international observers, including from the European Union and the US, were present for the vote.

More than 100,000 security forces were on guard on Sunday — 70,000 police and 32,000 troops — as seven million registered voters were called to the polls.

Military surveillance was especially tight in border regions near Algeria and Libya where Islamist extremists are active.

Tunisia is also holding its parliamentary election on October 6, another challenge since the new president’s success will depend on having support in parliament.

Sunday’s first-round vote is only the second democratic presidential election Tunisia has seen since the 2011 popular uprising brought down autocrat Zine El Abidine Ben Ali and triggered Arab Spring uprisings across the region.

Sunday’s election followed the death in office in July of the nation’s first democratically elected leader, Beji Caid Essebsi. His widow, Chadlia Saida Farhat, died on Sunday, aged 83, as Tunisians were voting, his son Hafedh announced on his Facebook page.