HAMBURG, Germany (AP) _ The prosecutor in Mathias Rust's attempted murder trial demanded Wednesday that the presiding judge resign because he discussed the defendant's testimony with a psychiatrist for the defense.

The motion by prosecutor Dieter Rohlf could cause a mistrial in the case, which is being heard by a panel of three judges headed by Juergen Schenck.

Rust, who became a German folk hero in 1987 when he landed a small airplane in Moscow's Red Square, is charged with stabbing a fellow worker at a hospital after she spurned his romatic advances.

The charge carries a maximum penalty of life in prison. The victim has filed separate civil charges over the 1989 attack.

The two other judges and an independent colleague are to consider the prosecutor's motion Thursday, the day a verdict had been expected. Rohlf based his complaint on an admission by Schenck that on Tuesday he discussed Rust's testimony with Dr. Johann Burchard, a psychiatrist who was appearing as a defense witness the next day.

Burchard and psychologist Herbert Maisch both testified Wednesday that the 23-year-old Rust had a serious ''personality disturbance'' and possibly could not be held responsible because of diminished capacity.

Meanwhile, Newsweek magazine quoted a defense lawyer as saying that while Rust was in Soviet custoy, he was given drugs in an effort to learn how he reached Red Square without being detected and if he had ties to the Central Intelligence Agency.

The magazine said medical specialists for the defense said the drugs could cause blackouts and bouts of aggression years later.

The lawyer, Yitzhak Goldfine, declined to talk to The Associated Press about the report.

In testifying Monday, Rust said he had a blackout shortly after the victim went into what he called a ''tirade'' as he put his hand on her shoulder in a prelude to asking her out for dinner.

He also testified he was given an injection while in Soviet custody. He said he did not know what type of drug he was given.

On May 28, 1987, Rust flew from Finland to the Soviet Union in a borrowed Cessna 172, landing in the middle of Red Square. His undetected violation of Soviet airspace so embarrassed Moscow that President Mikhail S. Gorbachev retired the defense minister and fired the air defense chief.

Rust insisted he made the flight to deliver a message of peace, but he was convicted of hooliganism. He was released after a year in prison and returned home to a hero's welcome in August 1988.