SANTA CRUZ, Calif. — A California prostitute charged with killing a Google executive with an overdose of heroin aboard his yacht pleaded guilty Tuesday to involuntary manslaughter and administering drugs.

A Santa Cruz County Superior Court judge sentenced defendant Alix Tichelman to six years in prison under a plea deal that included reducing a manslaughter charge.

Authorities say Tichelman injected Forrest Timothy Hayes with heroin in November 2013 then left without seeking help when he passed out on the yacht. Hayes had hired Tichelman several times before and they were doing drugs and having sex the night he died, authorities said.

Defense attorney Larry Biggam said Tichelman was relieved to have the court proceedings behind her and she is expected to serve only three years. She will be credited for nearly a year already served.

Tichelman agreed to the plea deal in light of the evidence, the lawyer said.

“It was an accidental overdose between two consenting adults,” he said.

The high-end call girl was arrested eight months after Hayes’ death. A surveillance video at the Santa Cruz harbor showed the woman gather her belongings, casually step over Hayes’ body, finish a glass of wine and lower a blind before leaving the yacht the night before the body was discovered.

Tichelman had been preparing to move out of California when she was arrested, She has wealthy parents and dual citizenship in the U.S. and Canada.

Prosecutor Rafael Vazquez was not immediately available for comment.