Malaysia's opposition leader believes his party could be strengthened if a court rules against him in a sodomy trial on Monday, with an economic showdown already threatening to damage the ruling coalition with polls expected this year.

Malaysia is bracing for possible unrest after the two-year trial ends, with supporters of opposition leader Anwar Ibrahim hoping to draw 100,000 to a rally outside the courthouse where the verdict in the trial is due to be read on Monday.

The trial has polarised opinion in conservative, majority Muslim Malaysia. The High Court decision could deepen political divisions further as Prime Minister Najib Razak, branded a hardliner by the opposition, weighs whether to call elections this year.

Police have warned people not to gather outside the court. Mass protests could cast doubt on Malaysia's political stability and spook investors, who are vital to achieving Malaysia's target of attracting $444 billion (284 billion pound) of investment by 2020.

Anwar, a former finance minister, told Reuters in an interview that Najib's ruling coalition has to decide, Anwar in prison, is it better for them or not?

I'm not sure whether it's better for them. We've done a lot to explain to the masses. (The opposition) may emerge slightly stronger, said.

Once the rising star of Malaysian politics and a former deputy premier, Anwar's political fortunes have since been marked by long-running legal battles over charges of sodomy -- sex between males is illegal in Malaysia -- after he was sacked by former Malaysian premier Mahathir Mohamad in 1998.

Anwar, 64, is charged with sodomising a 26-year-old male former aide and faces up to 20 years in prison if found guilty.

It is the second time he has faced what he says are politically motivated charges aimed at wrecking his political career and ending his challenge to the government.

In 1998, at the height of the Asian financial crisis, Anwar, then deputy prime minister and heir apparent to Mahathir, was accused of sodomy and corruption, sacked, tried and eventually sentenced to a total of 14 years in jail.

The cases have been marked by lurid details, including a semen-stained mattress produced in evidence, that have mesmerised Malaysians. A conviction that exposes weaknesses in Malaysia's judiciary to wider scrutiny could once again put the Southeast Asian nation under the international spotlight.

FAIR ELECTIONS?

Although elections are not due until 2013, there is widespread expectation Najib will call a snap poll this year. Anwar said he expected elections sooner rather than later, adding that his Pakatan party should be able to secure a simple majority in parliament.

Our concern is how do we ensure fair elections? he said.

This is a major problem for the opposition because, although there have been some announcements and some easing, but not (in) media control, not the judicial process, not in terms of any excesses, abuse and corruption and the electoral process, he said.

Anwar said support for the opposition among native Malays increased substantially after his 1998 conviction. He was freed in 2004 after the sodomy conviction was overturned.

But in 1998, we failed to garner enough support of the Chinese and Indians, he said, referring to two other major Malaysian ethnic groups.

Society will say: 'Okay, you may disagree with Anwar but you don't need to beat him up or continue to put him in prison.' This is my third, fourth time, they know it's political, Anwar said of the electorate.

Najib, who took office in with a strong majority after elections in 2009, has seen his approval ratings fall in the past year, in part because of a widening religious divide that has alienated minority non-Muslims.

Stubbornly high inflation and the slow pace of promised political reforms have also been sources of frustration.

There is greater awareness of the abuse of power, of endemic corruption, Anwar said when asked what had changed public sentiment since 2009.

A weaker economy could also work in the opposition's favour. Malaysia's economy grew at a stronger-than-expected 5.8 percent in the third quarter, but a slowdown in global trade will likely crimp growth in the coming quarters.

Malaysia is also vulnerable to sudden capital flight. Foreign ownership of stocks and bonds is larger than the country's foreign exchange reserves. Portfolio outflows jumped to 23.4 billion ringgit in the third quarter, a sharp reversal from the second quarter's 48.1 billion in inflows.

(Writing by Emily Kaiser; Editing by Paul Tait)