TUNIS, Tunisia (AP) — A media mogul and a former law professor who are vying to be Tunisia's next president sparred during a televised debate over how to fight terrorism and poverty — and then they cordially shook hands.

Tunisian voters celebrated the handshake as a sign that the democracy built on their country's 2011 Arab Spring uprising is on the right track. For all the problems its next leader will inherit, Tunisia remains a haven of political diversity and relative peace in a region long dominated by autocratic leaders.

Tycoon Nabil Karoui and professor Kais Saied are competing in the North African's country's a runoff presidential election on Sunday. They were the top finishers in the first round of voting month even though neither man ever has held political office.

Their electioneering was somewhat extraordinary.

Karoui, 56, was in jail from August until three days ago on money laundering and tax evasion charges he says are politically driven. His wife campaigned for him while he worked to get released.

Youth supporters did much of the campaigning for Saied.

During Friday night's debate, Karoui promised to combat extremist violence by "attacking at its roots" - the poverty in struggling provinces that are fertile recruiting grounds for the Islamic State group and other extremists.

He said he would attract foreign investment in the digital economy and seek partnerships with companies such as Microsoft, Google and Netflix to create jobs.

The enigmatic Saied, dubbed "Robocop" for his austere bearing, vowed to give poorer provinces and youth more decision-making power.

"The real Constitution is the graffiti scrawled on walls by young people who aspire to live in dignity," he said.

Saied is considered conservative on Muslim issues, and opposed an effort by the previous president to give daughters the same inheritance rights as sons.

He has the backing of moderate Islamist party Ennahdha, which won last week's parliamentary elections, but described himself as politically neutral.

"I am independent and will remain so until the end of my life" he said. "But if there are parties that want to support me, I can only thank them, nothing more."

Both men said Tunisia should work to bring peace to neighboring Libya.

Tunisia, which is tucked between Algeria and Libya in North Africa, holds tough challenges for the new president, from bolstering a flagging economy, injecting hope into the despairing hinterlands and staying atop a constant counter-terrorism effort.

___

Elaine Ganley in Paris, Nadine Achoui-Lesage and Mehdi el Arem in Tunis contributed.

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.