The Court of Appeal said "draconian elements" of the law had been misused to keep Hizbullah detained and called on parliament to reform the act before granting him bail.

Monday's decision comes just weeks before his case was due to be discussed at the UN Human Rights Council meeting in Geneva, according to diplomats.

Dozens of rights groups have campaigned for Hizbullah's freedom, and his detention has been highlighted by the European Parliament, which has also censured Sri Lanka over its rights record.

Local rights activist Bhavani Fonseka said news of Hizbullah's impending release was "welcome", but called for reform of the PTA, which had allowed the indefinite detention.

"This (release) should not distract from the need to repeal the PTA with a clear signal from the European Union and others that token reforms will not suffice," she said on Twitter.

Hizbullah was a vocal advocate of Sri Lanka's minority Muslim community.

He earned the ire of the island nation's ruling family after successfully challenging an effort to return former president Mahinda Rajapaksa to power during a constitutional crisis in 2018.

The following year, Mahinda was appointed prime minister after his younger brother Gotabaya won presidential elections.

UN human rights chief Michelle Bachelet called for "renewed attention" to the intimidation of journalists, lawyers and activists in Sri Lanka after the Rajapaksa clan returned to power.