A man charged in the deaths of his wife and friend told officers he had consumed eight to 10 beers and was driving 40 to 50 mph when the utility terrain vehicle carrying the trio slammed into an oak Sunday evening.

James Shankle, 48, told officers “I just killed my wife and my best friend,” according to a court affidavit from New Hampshire Fish and Game Conservation Officer Robert McDermott.

Shankle faces two charges of negligent homicide and a charge of aggravated driving under the influence.

In Rockingham County Superior Court Tuesday, Judge Martin Honigberg agreed to release Shankle on personal recognizance bail under a series of conditions, including that he stay with his daughter, not drink alcohol and not drive a vehicle.

Rockingham County Attorney Patricia Conway had argued against his release, saying he had threatened to harm himself.

Later in the afternoon, the court said it had new information related to the risks Shankle posed to himself and the community and issued a new order saying Shankle should be held pending another hearing on Wednesday.

About 7:30 p.m. Sunday, Shankle was driving a Red Polaris 400 utility terrain vehicle on his property in Candia with Renee Shankle, 50, and Alan Juza, 62, as passengers. Shankle told McDermott the accelerator stuck and he hit the tree; he later said the steering wheel malfunctioned.

McDermott wrote there was no indication of braking before the crash. A responding officer noticed alcohol on Shankle’s breath; beer cans, one half-full, were found around the crash site.

According to the affidavit, it appeared Shankle and his two passengers were all sitting in the front bench seat of the vehicle.

Shankle was treated at a hospital after the accident. He refused a blood draw to test his alcohol level, McDermott said.

Defense attorney Joseph Welsh argued in court that Shankle should be given personal recognizance bail.

“He’s not talking about harming himself at all, he has no history of mental illness suggesting self-harm,” Welsh said. “It’s a horrible accident. It’s a very serious legal matter, but nevertheless he is not a threat to harm himself.”

In June, a mother and son from Auburn died when their side-by-side, off-road vehicle crashed into a tree off Beaver Rock Road. Speed was a factor in that crash, which killed the driver, Craig Ford, 34, and his mother, Wendy Ford, 51, police said.