A Sri Lankan court on Friday dismissed a legal challenge to presidential candidate Gotabaya Rajapaksa's Sri Lankan citizenship, removing a major barrier he faced in contesting the Nov. 16 poll.

The three-judge panel of the Appeal Court unanimously dismissed the case that challenged the validity of Rajapaksa's Sri Lankan citizenship, which he obtained in 2005.

Rajapaksa is widely seen as the election frontrunner because of his popularity among majority Sinhala Buddhists for his role in ending a 26-year civil war in 2009, ushering in a decade of relative peace until Easter Day bombings that killed 250 people.

Two civil activists challenged Rajapaksa's Sri Lankan citizenship document and argued that he did not properly obtain it in 2005, when he was a United States citizen.

Rajapaksa, 70, renounced Sri Lankan citizenship in 2003 to obtain US nationality, but returned to Sri Lanka two years later, applying for dual citizenship after his brother Mahinda Rajapaksa won the presidency. He renounced his US citizenship in May of this year.

Sri Lanka does not allow dual citizens or non-citizens to contest national elections.

A spokesman for Rajapaksa, Keheliya Rambukwella, said the decision was a ‘victory for the nation and democracy’.

Named by the main opposition Sri Lanka Podujana Peramuna (SLPP) party as its presidential candidate last month, Rajapaksa also faces uncertainty over a legal battle regarding misappropriation of funds.

Still, Rajapaksa's popularity has grown in recent months, especially after it emerged that the government had failed to act on repeated intelligence warnings from India ahead of the Easter blasts, which were claimed by the militant group Islamic State.

SLPP chairman G.L. Peiris said the court case showed a plot by opponents to stop Rajapaksa winning the Nov. 16 poll.

Supporters of the SLPP welcomed the decision with firecrackers in capital Colombo after the judgement was delivered in a packed court room following a three-day hearing.

Most Buddhist leaders, and some victims of the Easter attacks, have since expressed their desire for the Rajapaksa family to return to power.

The activists who filed the petition were Gamini Viyangoda, an official of a citizens' group and Chandraguptha Thenuwara, an artist and lecturer. They say they are campaigners for democracy, good governance and rule of law.

In the 2015 presidential election, they backed the winner, Maithripala Sirisena, against Mahinda Rajapaksa, a pro-China strongman.