(CNN) -- A Malaysian court on Friday overturned opposition leader Anwar Ibrahim's acquittal of the charge that he sodomized a former political aide, the latest twist in a long-running legal battle.
Anwar was acquitted of sodomy in January 2012. But the Court of Appeal on Friday ruled that he is guilty, state news agency Bernama reported.
Anwar, de facto leader of the People's Justice Party, has repeatedly said he is innocent, calling the case against him an attempt by the government to end his political career -- an assertion it has consistently denied.
"This is a travesty of justice -- a blatant disregard of the rule of law," said Azmin Ali, deputy president of the People's Justice Party and a member of parliament. "This case is a clear case of hurried justice."
When asked if this has anything to do with Malaysia's upcoming elections, Ali didn't hesitate in his response: "Certainly, they wanted to stop Anwar from contesting."
The previous trial at the Kuala Lumpur High Court lasted nearly two years. Prosecutors alleged that he sodomized the former aide, Saiful Bukhari Azlan, in June 2008.
But a judge found him not guilty, saying it was not safe to rely on DNA evidence that had been cited in the trial.
Sodomy, even if consensual, is an offense punishable by up to 20 years in prison in Malaysia.
Investigators arrested Anwar in July 2008, four months after a loose coalition of opposition parties that he led won 82 of 222 parliamentary seats in elections. It was the second time in the country's history that the governing party had failed to gain the two-thirds majority needed to amend the constitution.
He was the heir apparent to former Prime Minister Mahathir Mohamad until 1998, when he was sacked and charged with corruption and sodomy.
Anwar spent six years in prison after being convicted of corruption charges in 1999 and of sodomy charges involving his wife's former driver in 2000.
Malaysia's highest court overturned the sodomy conviction and ordered him released from prison in 2004. However, the corruption verdict was never lifted, barring him from running for political posts until 2008.