A Santa Rosa teen had smoked marijuana with friends at a Sonoma Coast beach prior to losing control of his car and crashing into an oncoming vehicle, killing one of his passengers and injuring three others, the CHP said.

Prosecutors on Tuesday charged the driver, Isidro Antonio Moya, 19, with felony vehicular manslaughter and driving under the influence of marijuana, as well as driving without a license, possession of concentrated cannabis and a vehicle infraction for allowing the car to cross the double yellow lines. He didn’t enter a plea.

Moya was driving with two friends in the car, including David Etling, 18, of Petaluma, who was killed in the May 4 crash on Valley Ford Road near the community of Two Rock.

On Thursday, Sonoma County Judge Jaime Thistlethwaite granted Moya’s request to be released from jail to live with family and be supervised with an electronic monitoring bracelet.

Moya’s attorney, Kevin McConnell, argued the teen posed no flight risk because he has no criminal record, works full time as a painter and has a strong family network. McConnell said Moya is deeply remorseful about the crash and grief stricken over the loss of Etling, a close friend to Moya and his brother. Moya is due back in court July 12.

About a half-dozen members of Moya’s family attended the hearing, and they raised their hands when the judge asked if the teen’s family was there.

Outside the courtroom, McConnell in an interview said he didn’t know if Moya had a medical marijuana recommendation. California law prohibits people under 21 from using cannabis without a doctor’s order.

CHP investigators said Moya was speeding east on Valley Ford Road when his car drifted right and lost control, causing it to spin into the path of a westbound 2012 Lexus.

Etling was killed and three others were injured, including another passenger in Moya’s vehicle and two people in the Lexus, Douglas Kaye, 70, and his passenger, Cessna Kaye, 82, who had major injuries. The two, both of Kentfield, were discharged from Santa Rosa Memorial Hospital in May, hospital officials said.