A Libyan court on Thursday reinstated Seif al-Islam Kadhafi, son of slain dictator Moamer Kadhafi, as a candidate in next month's presidential election, the latest twist in an increasingly shaky transition.

Seif al-Islam had emerged in July after years in the shadows, telling The New York Times that he was planning a political comeback to "restore the lost unity" of Libya, a decade after it was plunged into chaos by the 2011 NATO-backed revolt that overthrew and killed his father.

He had been the first heavyweight candidate to register for the election, part of a UN-brokered process aimed at bringing peace to the North African nation.

But the electoral commission last month rejected his application, pointing to articles of the electoral law stipulating that candidates "must not have been sentenced for a dishonourable crime" and must present a clean criminal record.

Seif al-Islam had lodged an appeal in the southern city of Sebha, but last week a "group of outlaws" launched an "odious" attack on the court, forcing it to shut hours before the hearing, the government in Tripoli said.

People gather at Martyrs' Square in Libya's capital Tripoli on November 19, 2021, to protest the presidential candidacy of Seif al-Islam Kadhafi, son of slain Libyan dictator Moamer Kadhafi People gather at Martyrs' Square in Libya's capital Tripoli on November 19, 2021, to protest the presidential candidacy of Seif al-Islam Kadhafi, son of slain Libyan dictator Moamer Kadhafi Photo: AFP / Mahmud Turkia

On Thursday the court ruled in his favour.

Western officials have talked up a United Nations-led peace process and insist on "inclusive" and "credible" elections starting on December 24 in the North African country, despite serious disputes over how they should be held, and questions over their credibility.

Thursday's ruling adds to such questions, Libya analyst Emadeddin Badi wrote on Twitter.

"The electoral process is slowly achieving a hat trick, destroying the credibility of the UN, of #Libya's judiciary, & of elections as a way (out) of the crisis," he said.

Seif al-Islam's lawyer Khaled al-Zaydi, however, hailed the candidate's reinstatement as "a victory for justice and the people's will.

Seif al-Islam Kadhafi (R) registers to run in Libya's presidential election, in a photo released on November 14, 2021 Seif al-Islam Kadhafi (R) registers to run in Libya's presidential election, in a photo released on November 14, 2021 Photo: libyan High National Electoral Comission FB Page via AFP / STRINGER

In a reminder of the near-impossibility of holding a free and fair vote, on Thursday the electoral commission said more than 2,300 voter cards had been stolen from five polling stations by armed men in western Libya, including Tripoli.

Seif al-Islam, who is wanted by the International Criminal Court (ICC) for alleged war crimes, was among 25 candidates whose bids were rejected by the elections board last week.

He is far from being the only controversial figure to lodge a bid for the presidency.

Among them is military strongman Khalifa Haftar, who controls much of eastern and southern Libya and is despised by many in the country's west after his ruinous year-long assault on Tripoli that ended in mid-2020.

Interim prime minister Abdulhamid Dbeibah, head of the UN-backed unity government in Tripoli, is also in the running despite two petitions against his candidacy. Those were rejected on Wednesday by a Tripoli appeals court.

Amanda Kadlec, a former member of a UN panel of experts on the country, told AFP that "political divisions that were supposed to be put to rest with the formation of the 'unity' government are replaying with this electoral process."

She said Seif al-Islam "represents a constituency that is nostalgic for his father's reign" but, "Those who ousted the regime clearly want to prevent him from running -- not to mention that he's wanted by the ICC."

In the Times interview, Seif al-Islam said he wanted to "restore the lost unity" of Libya after a decade of chaos.

The ICC in the Hague has repeatedly asked for him to be handed over for trial for crimes against humanity, specifically "murder and persecution" allegedly committed using state forces across Libya in February 2011.

Seif al-Islam had been sentenced to death by a Tripoli court for crimes committed during the revolt that toppled his father, but a rival administration in eastern Libya later pardoned him.