A criminal case in which a D.C. policewoman refused a judge's order to submit to a drug test ended in a mistrial yesterday when a D.C. Superior Court judge ruled that it would be "very difficult to assess" how the officer's testimony and subsequent publicity had affected the jury.

Judge Rufus King, dismissing the jury in the trial of a man accused of unlawful entry of a convenience store, said the "unprecedented situation . . . wreaks havoc on the job the government has to do, the job the court has to do and, indeed, the job the defense has to do."

On Tuesday, King held Officer Amelia Scott in civil contempt after she refused to submit to a urinalysis that the judge ordered because he suspected she might be under the influence of drugs. Scott, who works the midnight shift at the 7th District, told the judge she was just tired when she took the witness stand.

Meanwhile yesterday, the police department's Internal Affairs Division disclosed it had begun to investigate the incident at the direction of Chief Maurice Turner.

The contempt order has surprised many judges, prosecutors and defense attorneys, who described King's ruling as an ambitious attempt to clarify a murky legal situation, and caused outrage among police, who said it amounts to "harassment" of officers at a time when they already are under attack by defense lawyers.

Drug testing is a sensitive issue for D.C. police officers, who in 1983 won a court order barring the department from conducting random drug tests. Testing is permitted only for officers on probation or undergoing medical exams.

The action came in the misdemeanor trial of Michael Savoy, 25, a roofer for a Northern Virginia firm who was arrested by Scott last November after a break-in at a Southwest convenience store.

According to sources who were present in the courtroom, King became suspicious of Scott's demeanor. Sources said she appeared to have trouble walking straight when she approached the witness stand, that she didn't respond when the clerk tried to swear her in and that she seemed to be sniffing.

Scott, advised by attorneys who had been summoned from the Fraternal Order of Police, refused to be tested, and King found her in contempt of court. The judge said he would fine Scott $25 for each hour that she did not report for the test.

Attorneys for Scott said yesterday they will appeal.

U.S. Attorney Joseph diGenova declined to comment, saying his office was consulting with police and court officials.

Abbe Jolles, attorney for Savoy, requested the mistrial. "There's no way to gauge the impact of that officer's testimony . . . . There's no way to assess the impact when you tell the jury, hey, forget about the testimony," he said.

King, expressing concern that jurors might have seen a Washington Post article about the incident, granted the mistrial.

Scott could not be reached for comment yesterday nor could her work status be determined. Her attorney, James Malloney, said she is "very upset" about the situation, but that she has received numerous phone calls of support.

"She is the Rosa Parks of the police department," said Malloney.

He said that his client had had little sleep since she started her usual midnight shift on Sunday. "She worked Sunday night and spent all day Monday in court, and then she worked Monday night and was in court all day Tuesday.

"She was sleeping in a witness room, with her legs propped up on a chair, when she was called to the stand," said Malloney. "She had never been in that particular courtroom before and she hesitated when called to give the oath. She had to look around for the clerk. That hesitation was one of the things the judge noticed."

Several officials said yesterday that officers frequently doze off from exhaustion when they come to court after working.

"It happens quite frequently," said Inspector Thomas Carroll, head of the police liaison office at the court. "They could sit here all day waiting to testify."

An officer with the Repeat Offenders Project, who asked that his name not be used, said, "People have to understand that officers who work nights are different. It is hard to stay awake in court if you have been working all night. You drink coffee or take those caffeine tablets and you end up looking like a piece of popcorn about to pop."

Officer Robert Falkosky, a 13-year veteran, said, "There have been many times I have fallen asleep waiting for a trial. You wake up and your leg is asleep and you have trouble walking." He added, "The police officer is just another witness. There are thousands of junkies who get called to testify and they sit in court nodding off and no one ever says anything to them. This happened just because she is a police officer."

Officer Pam Reed, with eight years on the job, said the judge "doesn't know our work conditions. We go days without sleep," she said. "You work all night on the street and you are in court all day. You end up feeling like a zombie.

"Judges work 9 to 5, we are often working for 16 hours, when you count in court time," said Reed.

Detective Hosea Dyson, a 15-year veteran, said, "I don't think the judge had jurisdiction to do that. If he had a problem with her condition, he could have contacted the police department and had them determine her condition."

Under D.C. law, judges have an obligation to ensure the competency of all witnesses who testify. Witnesses "must be competent to understand the oath and to clearly and accurately portray what they've seen," said Paul F. Rothstein, a professor at Georgetown University Law Center. "Drug use would come under mental competence."

All parties agreed that it will be an appeals court that will decide if the judge acted properly, and Malloney said it might be as long as six months before such a court rules.