A Northern California sheriff’s deputy has turned himself in to law enforcement after he was accused in the killing of a husband and wife in their home, authorities said.

Devin Williams Jr, a deputy with the Alameda County Sheriff’s Office, called authorities in the hours after the shooting and said he wanted to turn himself in, officials said.

Police stayed on the phone with him until the off-duty deputy was taken into custody by the California Highway Patrol near the Central Valley’s city of Coalinga, about 160 miles south of the crime scene.

Police were called to a home in Dublin — a city in the East Bay about 35 miles from San Francisco — at around 12.45am on Wednesday morning.

The 911 caller said two people had been shot inside the residence and the suspect, later identified as Williams, had fled in a vehicle.

Police said Williams used his service weapon in the shooting and discarded it as he fled.

Williams apparently knew the couple but investigators were still trying “to fine-tune their connection” and determine the motive, according to Alameda County sheriff’s spokesperson Lt Ray Kelly.

Both victims, whose names were not immediately released, were pronounced dead at the scene.

Mr Kelly said a male relative of the couple who was visiting was unhurt and was talking to detectives about what occurred.

Witnesses identified the gunman as Williams, 24.

Mr Kelly said Williams has been with the sheriff’s office since September 2021 and was still on probation. He had been assigned to the Oakland courthouse and there were no concerns about his job performance.

Williams, who is from Stockton, briefly worked with the Stockton Police Department, where he completed their police academy but was ultimately let go after he failed their field training programme, Mr Kelly said.

Stockton Police spokesperson Officer Joseph Silva said he could not discuss why Williams left the department because it is a “personnel matter”.

He confirmed Williams worked for the Stockton Police Department from January 2020 to January 2021.

The Deputy Sheriffs’ Association of Alameda County, the union that represents rank-and-file deputies, did not immediately respond to a request for comment.