The two shots that killed Prince George's County police officer Antonio Kelsey were fired accidentally during a struggle for the officer's gun, murder defendant Steven Baines testified yesterday at his trial.

"His hand pushed back on me . . . and that's when the gun went off . . . bam! [Kelsey] made a noise . . . When I went to pull off of him, bam, the gun went off again," said Baines, 27, on trial in Prince George's Circuit Court.

"It seemed like every time I released my grip off the gun, it went off," Baines told the jury.

Baines said the struggle began when Kelsey, 22, working off-duty on Feb. 2 in plainclothes as a security guard in a Landover liquor store, grabbed him around the neck and put a gun to his head following a chase.

Baines, who could be sentenced to death if convicted of first-degree murder, said Kelsey never identified himself as a police officer, and that he thought he was a robber.

Prosecutors maintain that Kelsey followed Baines out of Cox's Liquors, 7600 George Palmer Hwy., to arrest him after the defendant waved a bag of marijuana in front of the officer.

The incident began shortly after 8:30 p.m., when Baines drove to Cox's with a girlfriend, Cheryl Lynn Talbert, to buy liquor. Charles Mayhew, a friend of Baines, and two young girls related to Talbert accompanied them.

Baines acknowledged in his testimony yesterday that a bag of marijuana he was carrying became visible when he reached into his pocket to pay for a purchase at the liquor store. "When I pulled the money out of my pocket, I pulled the marijuana out also. The reefer came to the top of my pocket . . . I picked the money out and put the reefer back," he said.

As he and Talbert left the store, Baines testified, "someone grabbed me [by] my right hand and [spun] me around. I turned and saw a young fellow in front of me so I told Cheryl to go to the car," where Mayhew and the two young girls were waiting.

"Young boy, what's your problem, what do you want?" Baines said he demanded. Kelsey then backed him between two cars, Baines testified, and "made a motion to go into his pocket."

"I don't know whether he was going for a weapon or not," said the defendant. "That's when I realized that he was close, too close."

Baines said he pushed Kelsey away and dashed off, tossing the marijuana on the ground, in hope that his pursuer was interested in the drugs rather than money.

As they ran, Baines said, Kelsey struck him on the back of the head two or three times.

Baines said he turned around and saw that Kelsey had a gun in his right hand. They struggled and suddenly the officer was choking him around the neck, with the gun pressed against his head, Baines said. "I didn't want him to shoot me," the defendant told the court. "I took a chance; I grabbed the gun that he had and pulled him over me."

They wrestled on the ground, and he was lying on top of Kelsey, Baines said, when the gun went off. Two prosecution witness, Talbert and her 12-year-old sister Juanita, have testified that Baines was kneeling or standing when the shots were fired.Renee Fleming, Talbert's 11-year-old cousin, corroborated Baines' account yesterday.

Baines said he then got into Talbert's car, which she had driven up to the scene of the struggle, and they drove away. "I didn't know what to do," he said. "I knew the man was probably there hurting."

Baines threw the gun into the Anacostia River after spending the night with Talbert, but didn't know he had killed Kelsey until he read about the shooting in a newspaper that morning, Baines said. The defendant turned himself in later that day.

Defense attorney R. Kenneth Mundy called Mayhew to testify, but Mayhew, a lifelong friend of Baines, refused to answer questions, citing his Fifth Amendment privilege against self-incrimination.

Prosecuter Arthur A. Marshall said he plans to call rebuttal witnesses today who will say Baines and Kelsey may have known each other. Mundy said he would fight introduction of such testimony.