Mr Anwar has called the charges part of a political smear campaign
A Malaysian court has sentenced opposition leader Anwar Ibrahim to five years in jail after overturning his acquittal on sodomy charges. Tb840a
Mr Anwar led the opposition to its strongest ever performance in the May 2013 general elections.
While homosexual acts are illegal in Muslim-majority Malaysia, very few people are ever prosecuted.
Mr Anwar has always maintained the charges were part of a political smear campaign.
The court decision will affect Mr Anwar's plans to compete in a key by-election in the state of Selangor this month, reports say.
A victory for Mr Anwar would mean he could become Selangor's chief minister - widely seen as a powerful post.
The court said he could remain free on bail while he appeals against the verdict to the country's highest court, AP news agency reported.
"All over again, after 15 years, they want to put me in the lockup and that is why they are rushing," Mr Anwar said after his acquittal was overturned.
He added that Prime Minister Najib Razak's government "faces the wrath of the people".
Meanwhile, a government spokesman said: "This is a case between two individuals and is a matter for the courts, not the government."
In 2008, Mr Anwar was accused of having sex with a male aide. A High Court cleared him of the charges in 2012, citing a lack of evidence.
The government later appealed against his acquittal.
The court decision comes ahead of a by-election Mr Ibrahim planned to contest
"It's truly a dark day for the Malaysia judiciary which has shown itself incapable of standing up straight when national political issues are in play in cases before them," Phil Robertson, deputy Asia head of group Human Rights Watch, said after the verdict.
Correspondents say Mr Anwar is seen as the key challenger to the ruling party, which has been in power since Malaysia's independence in 1957.
The Barisan Nasional coalition won 133 of the 222 seats in parliament in the 2013 elections - although it won the elections, it was the coalition's worst ever result.
Thousands of Malaysian opposition supporters rallied against the result, alleging that the polls were fraudulent.
Mr Anwar was previously a member of the Barisan Nasional coalition, but fell out with top leaders and was sacked in 1998.
He was then charged with sodomy and corruption, and given a six-year jail term for abuse of power, which sparked huge street protests.
In 2000 he was also found guilty of sodomy with his wife's driver and jailed for a further nine years.
In late 2004 Malaysia's Supreme Court overturned the sodomy conviction, freeing him from jail.
He then emerged as a leader in the opposition movement, leading it to increasingly strong performances in both the 2008 and 2013 elections.
Anwar: The man who waited decades to lead Malaysia
Rally against Malaysia vote outcome
Anwar urges Malaysia polls protest
At least two dead and 68 injured after car driven into crowd at German Christmas market
Video shows moment Magdeburg suspect is arrested
House passes bill to fund US government in crucial step towards averting shutdown
What is a US government shutdown?
The Papers: Christmas market 'carnage' and 'Return of the family doctor'
Dominique Pelicot's double life: Who is the man who plotted his wife's mass rape?
Christmas getaway: Tips to avoid disruption
Syria's rebel leaders say they've broken with their jihadist past - can they be trusted?
Why self-confessed 'superfans' were engrossed by Post Office inquiry
Ros Atkins On... Four reasons why the relationship between the UK and China is strained
Peter Mandelson: How the Prince of Darkness became his excellency
Weekly quiz: Which Christmas dinner ingredient went up in price?
The astonishing double life of a secret agent
Trace Stakeknife's story, an agent who walked the tightrope between the IRA and British Army intelligence
Grown-up children, still the same chaos at Christmas
The Brockmans are back for a festive special, here's your first look
Can Paul Sinha compile a perfect pub quiz?
Joined by a live audience who will share their favourite quiz questions
Kevin Bridges is back and funnier than ever
Expect a shrewd and hilarious outlook on the modern world in his show from his sold-out live tour
Pm856k01 3bse018104r1 © 2024 BBC. The BBC is not responsible for the content of external sites. Read about our approach to external linking.