Jailed Malaysian opposition leader Anwar Ibrahim lost his final bid for freedom on Wednesday when the federal court rejected his appeal to set aside his sodomy conviction and five-year prison term.

A five-member panel of judges ruled unanimously that there was no merit in Anwar's application for a review of his 2014 conviction, his final legal option for an acquittal. He will now have to serve out the remaining 16 months of his prison term.

"This is not a fit or proper case for this court to exercise its inherent jurisdiction to initiate a review," Zulkefli Ahmad Makinudin, the chief judge of Malaya, said as he read excerpts from a 60-page ruling.

Anwar, once a rising star in the ruling party, is the greatest threat to Prime Minister Najib Razak and his coalition after leading a three-party opposition alliance to stunning electoral gains in 2013.

He was convicted and jailed for sodomizing a former aide, a charge that Anwar and his supporters say was a politically motivated attempt to end his career.

"This is not the end of the road. ... I have pleaded and reiterated my innocence, but the judiciary has ignored my pleas," Anwar told reporters in the court after the verdict. "This is a long walk to freedom."

His wife, children and grandchildren were in court. Crowds of supporters gathered outside in a show of support for their 69-year-old leader.

A former ruling party deputy prime minister, Anwar's legal troubles began soon after he fell out with then Prime Minister Mahathir Mohamad in the late 1990s and was sacked.

He then campaigned against corruption and nepotism and led a nationwide reform movement. He was later jailed for the first time on charges of sodomy and graft.