Mr. Anwar, 51, denies the charges and says they were fabricated because Prime Minister Mahathir bin Mohamad considered him a threat to his 17-year rule.
Mr. Anwar remains popular, and armed riot police guarded the street outside the courthouse Wednesday in case of trouble. A water cannon truck was parked nearby.
As the trial continued, Mohamed Said Awang, former chief of the special branch, the government's top police intelligence unit, told the court that Mr. Anwar had ordered him to arrest two people who had made allegations against Mr. Anwar.
On Tuesday, Mr. Mohamed Said said the special branch had begun an investigation into sexual misconduct by Mr. Anwar in 1992, a year before he was named to his cabinet posts. In August 1997, the investigation turned serious, with two statements accusing Mr. Anwar of adultery and sodomy.
One statement, by Mr. Anwar's personal driver, Azizan Abu Bakar, said Mr. Anwar sodomized him 15 times. The other, by Ummi Hafilda Ali, the sister of Anwar's private secretary, said her brother's wife had had sex with Mr. Anwar.
Mr. Azizan and Mrs. Ummi were detained and questioned, Mr. Mohamed Said said, adding that Mr. Anwar demanded written retractions from them. Mr. Mohamed Said said he secured the retractions and forwarded them to Mr. Mahathir.
Mr. Anwar scribbled furiously on a legal pad during Wednesday's hearing.
Defense lawyers were expected to argue that the charges against Mr. Anwar were based on flimsy poison-pen letters and part of a government conspiracy against him.
Mr. Mahathir dismissed Mr. Anwar on Sept. 2, saying he was morally unfit to be his heir apparent as leader of Malaysia.
The case gained additional drama after Mr. Anwar showed up at his arraignment Sept. 29 with a black eye and bruises. He contended that police beat him after his arrest, though Mr. Mahathir suggested that the wounds might have been self-inflicted.
Tens of thousands of Malaysians have expressed solidarity with
Mr. Anwar, participating in street protests since his arrest Sept. 20.
One of those demonstrations turned into a riot two weeks ago when police
fired tear gas and water cannon at stone-throwing protesters.