NEWPORT, N.H. — A Vermont man accused of murdering his wife the day she filed for divorce told a friend weeks earlier that he would kill her, a prosecutor said during opening statements Thursday. Later, a witness described the gruesome condition of her body when it was discovered in the woods.

A lawyer for James Robarge, 45, assured the Sullivan County Superior Court jury that his client did not kill 42-year-old Kelly Robarge and promised that Robarge would take the stand and tell them that.

Kelly Robarge had filed for divorce from her husband of more than 20 years on June 27, 2013, the day she disappeared from her home in Charlestown, New Hampshire. She texted a friend that her husband was at the house and that she was going to tell him about the divorce filing.

Her badly decomposed body was found 10 days later in Unity. A medical examiner concluded her death was caused by homicidal violence, but could not pinpoint the fatal injury because of the state of the body, which had been ravaged by animals.

“He dumped her out in the woods like a piece of trash and left her out there in the woods to rot,” prosecutor Diana Fenton told jurors.

She told them the entryway to Kelly Robarge’s home contained “countless” blood splatters and that James Robarge’s disabled car, found several miles from where her body was discovered, had a bloodstained trunk and bloodstained items outside it, including a speaker cord.

Fenton said Robarge deliberately killed his wife and asked the jury to find him guilty of first-degree murder.

“James Robarge did not kill his wife,” public defender Alex Parsons countered. “James doesn’t know who or why or how.”

The last time Robarge saw his wife was the day before she disappeared, when he installed several doors at her house, Parsons said.

Parsons said a “mystery man” was seen near Robarge’s broken-down Volkswagen Jetta in a turnaround in Unity, “messing with James’ car.” He said that man has not been identified.

“There is no evidence when, where or how Kelly died,” Parsons said. “You need to know those answers.”

“James is the critical witness, but one you won’t hear from until after weeks of evidence from the state,” Parsons said.

Robin Millan of New England Canine Search and Rescue testified about discovering Kelly Robarge’s body off a remote logging road in Unity. She said her head was detached from her body and her hands were missing.

She and Department of Fish and Game Lt. James Kneeland testified they noticed a large scraped rock and streak of oil leading to it, but neither saw the metal fragments that prosecutors said matched metal from the oil pan of James Robarge’s car.

One of Kelly’s closest friends, Erin Kimball, told jurors about James Robarge’s reaction the day she cut his wife’s hair.

“He rambled on as he always did,” Kimball said. “He told her a couple of times he would kill her.”

Kelly Robarge’s mother, brother and her two adult daughters were in the courtroom. The daughters are expected to testify about domestic violence they witnessed involving their parents.

Robarge has been held without bond since his arrest the week Kelly Robarge’s body was found.

The trial is expected to last five weeks.