The sodomy trial of Malaysian opposition leader Anwar Ibrahim ended on Thursday after nearly two years of sensational testimony with the judge saying he would deliver a verdict on January 9, ahead of a general election expected early next year.

Anwar, 64, is charged with sodomising a 26-year-old former male aide and faces up to 20 years in prison if found guilty, which would effectively end his political career. The sodomy charges were filed several months after he led the opposition to unprecedented gains in the 2008 election.

Sex between males is a criminal offence in this mainly Muslim country.

Anwar has insisted the trial was a political plot to prevent him taking power at the next polls and was a repeat of a 1998 case, in which he was jailed on sodomy and corruption charges after being sacked as Deputy Prime Minister.

If they consider this political option to weaken the resolve of the opposition, I am convinced that after the 9th (of January), the opposition will grow even stronger whether Anwar is outside or inside jail, Anwar told reporters outside the courtroom flanked by supporters, who chanted Reformasi (reform) the battle-cry of an opposition which his 1998 conviction gave birth to.

Judge Zabidin Mohamad Diah ended the trial that began in February 2009 and which saw evidence including a tube of lubricant and pair of underwear belonging to Anwar's accuser Saiful Bukhari Azlan produced in the courtroom.

Anwar's lawyers questioned the DNA samples used to link him to the incident as well as the credibility of his accuser, who admitted to meeting Najib several days before the alleged incident took place.

Najib said he did meet Anwar's accuser, but before Saiful filed a complaint to the police in June 2008, and he denied interfering in the case.

Once the rising star of Malaysian politics as finance minister and deputy premier, Anwar was jailed for sodomy and corruption after he was sacked by former premier Mahathir Mohamad in 1998, with graphic details of the alleged offences made public. He was freed in 2004 after the country's top court overturned the sodomy conviction.

The next election is not due until 2013 but Najib is widely expected to call for one in the first quarter of next year before economic growth slows in a potential global downturn that could hit the export-dependent country.

But Najib's approval ratings have fallen over the past year due to a widening religious divide that has alienated minority non-Muslims as well as middle class anger over inflation and the slow pace of promised political reforms.

(Reporting by Razak Ahmad and Angie Teo; Editing by William Tarrant)