Tunisian presidential candidate Nabil Karoui, who faces an election run-off this month, must stay in detention for now on suspicion of financial crimes that he denies, a court ruled on Tuesday.
The television mogul was arrested in August on 3-year-old charges of tax evasion and money laundering, but came second in the first round of the presidential election last month.
It has raised difficult questions for Tunisia's young democracy, with his supporters saying he is the victim of political chicanery and his critics saying his campaign is based on the illicit use of his media channel.
Tunisia has been a democracy since 2011, when its people rose up in a revolution that ousted veteran autocrat Zine El-Abidine Ben Ali and inspired the "Arab Spring" uprisings.
The electoral commission has said Karoui can compete in the Oct. 13 run-off against retired law professor Kais Said unless he is convicted, though there seems little chance of an imminent verdict.
Said and Karoui's success in beating established political leaders including the prime minister, two former premiers and a former president, was seen as a sharp rebuke to Tunisia's ruling elite after years of economic discontent.
The electoral commission has warned that Karoui's detention may violate his right to a fair hearing with voters, putting it at odds with Tunisia's judiciary, which has repeatedly ruled that he must stay behind bars.
If he wins election, it is unclear if he could be sworn into office in prison instead of the parliament chamber, or if the immunity the constitution gives presidents would apply to crimes not yet tried in court.
A constitutional court mandated by the 2014 constitution which would normally adjudicate complex political questions has not yet been formed. The last parliament was unable to agree on which judges it should contain.
Tunisia's president has direct control over foreign and defence policy but can also obstruct legislation passed by the government and parliament.
A parliamentary election, in which Karoui's Heart of Tunisia party is running, will take place on Sunday. The biggest party in parliament can shape the choice of prime minister and the formation of a government.