A roommate of a man charged with killing a Johns Hopkins researcher in Charles Village last summer testified Wednesday that moments after the attack the suspect said he "had robbed someone and that he had hurt him real bad."

Tyrine Williams told jurors that she and her boyfriend, Kevin Cosby, then tried to use the victim's stolen credit card at a nearby gas station on Howard Street, and that they planned to use the proceedsto buy drugs to continue their 15-hour cocaine and heroin binge.

Her testimony came on the second day of John Wagner's murder trial in the death of Stephen Pitcairn, who was stabbed on St. Paul Street in July last year as he walked home from Penn Stationwhile talking on a cellphone with his mother, who was in Florida.

The killing enraged a neighborhood and became part of Gregg L. Bernstein's run for the office of state's attorney, which he won over incumbent Patricia C. Jessamy. He criticized what he said was his opponent's failure to put away convicted felons and said Pitcairn would have been alive had Jessamy done her job.

After the stabbing, police say, Wagner ran back to his rowhouse in the 2600 block of Maryland Ave., raced inside, leaving blood on the door handle and frame, and stuffed a fold-up knife and the victim's iPhone inside a white tennis shoe.

Williams' testimony directly implicates Wagner in the killing. The suspect's lover, Lavelva Merritt, was also charged with murder but prosecutors dropped those charges in exchange for her testimony against Wagner. She pleaded guilty to her role in the robbery of Pitcairn, and she could take the stand Thursday.

Wagner's defense attorney hammered back at Williams during cross-examination, pointing out discrepancies between her testimony on the witness stand and statements she made to homicide detectives the day of the killing and later to prosecutors.

Assistant Public Defender Gregory Fischer told jurors during his opening statement Tuesday that Cosby is the killer, and that Merritt was with Cosby at the time. On Wednesday, he accused Williams of lying to cover for her boyfriend of 15 years.

"Isn't it true that it was Cosby who said he had robbed a lady?" Fischer demanded of Williams.

"No," Williams answered.

Pressed again, Williams responded, "He didn't do that. There are other ways of getting money."

Under direct questioning from Assistant State's Attorney Josh Felsen, Williams described her troubled life in and out of jail and addicted to heroin and cocaine. She lived with at least a half-dozen others in the Maryland Avenue rowhouse, including Wagner.

Williams said that on the day of the killing, she and Cosby left the house about 9 a.m. and started buying and using drugs. At one point, they were at a bus stop on North Charles and 25th streets with Wagner, whom she knows as "Ya-Ya," and Merritt. She testified that Wagner told them "he was looking for someone to rob."

She testified that she and Cosby returned to the house later that night even as police swarmed the neighborhood. Two people were asleep, but she saw Wagner and another person in the kitchen. She said Wagner asked how to use a credit card. She testified she saw the card and a Florida driver's license with Pitcairn's name on it.

"He volunteered, he told us, that he had hit somebody at a gas station and that he had hurt him real bad," Williams testified. The prosecutor, Felsen, asked his witness whether Wagner had mentioned the victim's race. She answered, "No."

Shortly after Pitcairn was stabbed, police had said in charging documents that the suspects had been "hunting to rob" a "white boy." The racial angle and allegations that the attack had been premeditated added to the community's rage and set the case apart from other killings.

Fischer, the defense attorney, seized on Williams' statement when he questioned her later, saying it was Cosby, not his client, who had told her he had robbed a white victim. Williams denied that as well.

Williams said that she and Cosby failed in their attempt to use Pitcairn's credit card at the gas station because they needed his ZIP code. They returned to the house and got it from Pitcairn's driver's license. She said Wagner was reluctant to leave the house because by that time police were all over the neighborhood.