An off-duty District of Columbia police officer, on trial here in the slaying of a maintenance man who came to his home to change furnace filters, followed the janitor down a staircase and shot him several times when the maintenance man turned toward him, the prosecutor in the case said today.

Officer Anthony J. Zavosky, 25, was asleep after working the midnight shift when he was awakened by noises outside his bedroom, prosecutor Stephen Orenstein told Circuit Judge Perry G. Bowen. Picking up his service revolver from the holster on his dresser, Zavosky opened his bedroom door and saw the maintenance man, James Brown, a 53-year-old Baltimore resident, standing in front of him, Orenstein said. "Something was said," Orenstein continued, and Brown started walking down the stairs. Zavosky followed him, and then Brown turned around, according to Orenstein.

Zavosky saw "what appeared to be a screwdriver" in Brown's hand and fired his gun, Orenstein said.

Prince George's prosecutors have charged Zavosky, a four-year police veteran, with first-degree murder and carrying a deadly weapon in the February shooting in Zavosky's Greenbelt town house.

Publicity following the shooting, which included a story about the tenants of the town house complex being outraged over the shooting of the well-known janitor, prompted defense attorneys to ask that the case be heard in Calvert County, 40 miles south of Greenbelt. They subsequently asked that the case be heard by a judge rather than a jury.

Greenbelt police officers testified today that Brown's body was found just inside the town house door, that two dirty oil filters and a set of keys were found on the stairs inside the house, and two garbage bags containing other filters were outside the doorway. A screwdriver was found on the floor just inches from the victim's hand.

Officer Edward D. Blake told the court that officers called to the scene by Zavosky first believed the victim was an intruder. Blake, who said he knew Brown, a maintenance man at the complex for 12 years, testified under cross-examination by defense attorney Barry Leibowitz that he "realized what had happened when I saw the filters on the stairs." Zavosky was placed on administrative leave with pay after the shooting, and has been free on bond.

Another Greenbelt police officer, Fred Murray, testified that Zavosky told him he had been awakened by noises outside his bedroom door, and that when he went out of his bedroom, "he was face to face with a black guy in the hallway, and the next thing he knew he was shooting, and the smoke detector went off."

Janet L. Barry, whose town house is across a walk from the house where Zavosky lived, testified that she was dozing on her bed on the afternoon that Brown was killed, when she heard knocking on the door. She said she looked out the window, and saw Brown knocking on Zavosky's door, and calling out "maintenance."

Barry said Brown had replaced her furnace filters that morning. She said she was upstairs when Brown knocked on her door, but said he knocked loud enough for her to hear. She said Brown had left her a large notice the day before, saying he would call within the next 24 hours.