Andrew Sumner says he considered Ashley King a friend back in 2012, but on the witness stand Wednesday at Devin Baham’s trial for King’s murder, the relationship he described was that of drug dealer and user.

King’s number was programmed into Sumner’s cellphone under the name Ashleyyyrocks, a sly reference to the street name for the Oxycontin pills he bought from the 32-year-old Slidell woman.

And Sumner’s supposed friendship with King didn’t stop him from agreeing to rob her of drugs and money the day after Mardi Gras, Feb. 22, 2012.

Baham, whom he described on the stand as being like his big brother, wanted to “hit a lick,’’ Sumner said. It was Baham, two years older than Sumner, then 19, who suggested that King, who had drugs and cash, was an ideal target.

Sumner, who pleaded guilty in March to manslaughter, aggravated arson and obstruction of justice in the case, testified for nearly three hours Wednesday as part of the plea bargain that he struck with prosecutors.

As a person who was in King’s apartment when she was killed, he is the prosecution’s star witness, and his testimony consistently painted Baham as the instigator and chief actor and his own behavior as passive.

Sumner, who appeared nervous and uneasy on the stand, spoke in a soft monotone and was frequently admonished by Judge Allison Penzato to speak up and answer questions with words instead of nodding or shaking his head.

The original plan was for one of the men to distract King while the other grabbed the pills, Sumner said.

But when they arrived at King’s apartment on Bayou Lane in Slidell, he said, he noticed for the first time that Baham had brought a role of duct tape, which he hid in his pants. Sumner said he must have appeared nervous because King jokingly asked him if he was wearing a wire. He said he lifted up his shirt to show her that he was not.

Baham spotted the pills and cash in King’s purse, calling them to Sumner’s attention with a nudge and a nod. But then, Sumner said, his friend deviated from the plan, punching King in the face and then grabbing her from behind.

As the two fell to the floor, Sumner said, he ran into the kitchen, squatting on the floor and hyperventilating because of panic. From there, he could not see what was happening but heard yelling and a thumping noise. At one point, he testified, King said, ‘F***, I’m bleeding,’ and then screamed until she was silent.

At that point, Baham came into the kitchen and told him everything would be all right.

“He gave me a hug and said, ‘I love you, little buddy,’ ” Sumner said. He then left the kitchen and saw King lying still in a puddle of blood.

Under questioning by Assistant District Attorney Julie Knight, Sumner recounted a cover-up that began almost immediately.

The two had driven to King’s apartment in the car of Sumner’s girlfriend, Katelyn Lusich, who was then a pregnant 17-year-old. She had been riding in the back seat but at their instructions had gotten into the driver’s seat and turned the car around.

Baham stayed behind to clean up the crime scene, Sumner said, using all the cleaners he could find in the apartment’s bathroom and kitchen. Sumner, meanwhile, changed clothes, concerned that the hug from Baham might have put blood on his pants and shirt.

He later picked up Baham at nearby Heritage Park. They returned to Sumner’s parents’ house in Chamale, where Baham borrowed a change of clothes, putting his original garments in a trash bag along with the floor mats from Lusich’s car, the duct tape and the murder weapon: a knife that Sumner had bought several weeks before at Academy Sporting Goods.

Sumner testified that he had not seen the weapon until then. But he said he had purchased it at Baham’s request because he had been talking about robbing another person and there were too many difficulties in getting a gun.

They burned the bag of evidence at the home of Baham’s uncle, Sumner said. But Baham, whom Sumner described as orchestrating the cleanup, was worried that DNA remained at the apartment and decided they should set it on fire.

The two siphoned gas from a boat at Sumner’s home and set out to burn the place about 1 a.m., turning back when they saw a police car at the Heritage Park boat launch where they had planned to park.

They set out again at 5 a.m., entering the unlocked back door of King’s apartment. Sumner said his friend spread blankets on the floor and dragged King’s body on top of them, dousing her with gasoline and setting the plastic gas container on top of the body. He then lit a sock with a lighter and tossed it on the body, creating a loud “whoosh” as the two ran out, Sumner said.

King asked Sumner if he was aware that other people lived in the building and were likely in bed and at risk from the fire.

“I didn’t think about that,” Sumner said.

Earlier in the day, the jury heard testimony via Skype from Dr. Samantha Huber, an Orleans Parish pathologist who conducted the autopsy on King. She testified that King had 13 sharp-force injuries, four of which could have killed her. She said there was no way to determine whether the perpetrator was left-handed or right-handed.

Defense attorney Martin Regan, on cross-examination, stressed that Sumner is left-handed and his client, Baham, is right-handed. He noted that several of the wounds were on right side of King’s neck and chest, and that a defensive wound was on the palm of her right hand, which he said pointed to a left-handed assailant.

But Huber stuck to her contention that there is no way to tell how the victim and the killer were standing or how they may have moved. “There are four wounds, including fatal wounds, that you want me to ignore,’’ she said, referring to injuries on the left side of King’s body.

The trial will resume Thursday with cross-examination of Sumner.

Follow Sara Pagones on Twitter, @spagonesadvocat.