With two knife wounds to her chest, Melissa Stubbs used a towel to try to stanch the flow of blood from her husband as Robert Stubbs lay in the foyer of their apartment in Westbrook, stabbed eight times.

“I was trying to put pressure on it to stop it, but it was just soaking up,” she said in court Tuesday, fighting back tears. “He couldn’t breathe. There was a ticking sound coming from his chest. I couldn’t do anything. He said, ‘Momma, I’m going to die.’ I begged him not to.”

Melissa Stubbs was the first witness to testify in the trial of Tareek Hendricks, who is charged with murdering her husband and stabbing her on April 21, 2011, at the Stubbses’ duplex at 73 Central St. in Westbrook.

Hendricks, 32, of New York, was a crack cocaine dealer who brought drugs to Maine to sell, and the Stubbses were his drug-addicted customers, said attorneys on both sides in the trial at Cumberland County Courthouse in Portland. Hendricks has pleaded not guilty to charges of murder and aggravated assault, and has said in letters to the court that he acted in self-defense after being attacked.

Melissa Stubbs testified about the events that led to the stabbing. She said she and her husband smoked a $50 rock of Hendricks’ crack cocaine and a marijuana joint in their third-floor bedroom as they tried to concoct a way to get Hendricks out of their house without Robert Stubbs driving him around in their car to conduct cocaine deals, as they had agreed to do while bartering with the drug dealer.

Melissa Stubbs said she followed her husband downstairs to the first floor as the two men began to argue. She heard Hendricks, whom she knew by the nickname “BK,” tell them that “his boys” were on the way to attack them, and that they had already smashed the windows out of the Stubbses’ car.

“(Robert Stubbs) went over and got a bat and hit BK with it. He hit him a couple times, and BK kind of turned,” Melissa Stubbs told jurors. “I pushed them both in separate directions and told Bobby to put the bat down.”

Melissa Stubbs said she thought that Hendricks would leave their house at that point, as he and her husband walked to the front door, but instead Hendricks used a knife to stab Robert Stubbs, who still had the bat.

Melissa Stubbs then grabbed a chair, broke it over Hendricks’ head and poked him with the legs.

“I tried to do anything I could to get him off my husband,” she testified. “I was stabbed a couple times in the chest. (Hendricks) told me to stop hitting him because he didn’t want to hurt me.”

She said they somehow got Hendricks outside the house despite their injuries and locked him out as he yelled at them that he wanted his computer, bag and phones back.

Hendricks left Maine the day after the stabbing, and didn’t return until after his arrest on a warrant in Syracuse, New York, on July 11, 2012.

The case took many legal turns before reaching trial this week. Hendricks initially would not cooperate with the court, refusing to enter pleas to the charges and claiming that the court had no jurisdiction over him.

Hendricks went through three attorneys before his current attorneys, Jon Gale and Amy Fairfield, were appointed to represent him.

Hendricks also wrote a series of letters to the court from jail, addressing by name Justice Thomas Warren, the judge who is now presiding over his trial.

“I wish not to complicate your business, or lock horns with you sir. I have a great self-defense claim under statutory law, but the fact (is) that I have been discriminated against and prosecuted with the most harsh, severe charges, which are bogus, excessively coerced, fabricated and untrue,” Hendricks wrote in one of the letters, dated Aug. 25, 2013.

The case appears to hinge on whether jurors believe Hendricks’ claim that he acted in self-defense or believe he should have left the apartment when the Stubbses told him to go.

Deputy Attorney General Lisa Marchese, who is prosecuting the case, said a woman who was with Hendricks left the home as soon as the Stubbses told her to go. That woman, Jessica Berry, is expected to be called as a witness later in the trial, which is expected to continue into next week.

“The facts will show that he had plenty of opportunity to leave that house, as Jessica Berry did,” Marchese said.

Marchese warned the jurors in her opening remarks that many of the people who will be called as witnesses were connected to one another by their drug use. But she said people have the right to tell unwelcome guests to leave their home, and to enforce their demands.

“Bobby (Stubbs) was entitled to use the bat to remove him,” Marchese said. “(Hendricks) could have walked out the door. Instead, he decided to stab Bobby Stubbs multiple times, including in the back.”

Gale, who made opening statements for the defense, presented jurors with a bleak outline of how the case would unfold, but said the evidence would show Hendricks acted in self-defense after being attacked with a baseball bat.

“There is nothing redeeming, there is nothing happy about this case. There are no heroes. This is a case about troubled people,” Gale said. “We are confident when this is done that you may find that this case should never have been brought before you.”

Gale described Robert Stubbs as “very high on cocaine” when he came downstairs from his bedroom to confront Hendricks on the day he was killed. Autopsy results showed 670 nanograms of cocaine or metabolized cocaine per milliliter of blood, Gale said, more than three times the amount that might require medical treatment.

Melissa Stubbs is scheduled to return to the witness stand Wednesday to answer more questions from Marchese and to be cross-examined by Gale.