Mohamed Said Awang, former chief of Malaysia's top police unit, the Special Branch, was the first of 52 prosecution witnesses expected to take the stand in the government case against the jailed dissident.
"He [Anwar] talked to me about a certain letter containing wild allegations," Mr Mohamed told the High Court in Kuala Lumpur. "He asked me to see him alone."
Mr Anwar faces five counts of corruption and five counts of illegal sex acts.
He denies the charges and says they were created to undermine his growing challenge to the 17-year leadership of Prime Minister Mahathir Mohamad.
The former police chief testified that the Special Branch had launched operation Solid Grip, an investigation into sexual misconduct by Mr Anwar, in 1992. He was named deputy prime minister and finance minister in 1993.
In August 1997 the investigation produced a letter and a sworn statement that accused Mr Anwar of adultery and sodomy.
The prosecution said Mr Anwar got police officers to force the writers to retract.
The statement by Mr Anwar's driver, Azizan Abu Bakar, said his boss sodomised him 15 times.
The other, by Ummi Hasilda Ali, the sister of Mr Anwar's private secretary, said her brother's wife had sex with the former minister.
Both statements were also sent to Mr Mahathir, who said he fired Mr Anwar after he himself talked to people who said they had sex with his handpicked successor. Mr Mahathir said Mr Anwar was morally unfit to run the country and sacked him on 2 September.
"Whatever witnesses and documents the prosecution will bring to the court will prove beyond doubt that the accused abused the position as deputy prime minister and finance minister for his own personal gain," Abdul Gani Patail, the chief prosecutor, said.
"A poison-pen letter has become evidence," Mr Anwar said as the trial adjourned.
Defence lawyers opened their case on Monday by asking the judge to hold Mr Mahathir in contempt of court for saying publicly that Mr Anwar should be convicted.
Yesterday, riot police stood guard across the street from the court at Independence Square, where Mr Anwar led a huge anti-government protest just hours before his arrest. (AP)Reuse content