One of the three young drifters accused of killing a hiker in Marin County and a backpacker in San Francisco’s Golden Gate Park cut a deal with prosecutors Monday, pleading guilty to second-degree murder.

Sean Michael Angold, 24, changed his plea while agreeing to testify at the trial of his co-defendants, Morrison Haze Lampley and Lila Scott Alligood, in last year’s gun slayings of 67-year-old Steve Carter and 23-year-old Audrey Carey, authorities said.

Terrence Bennett, Angold’s attorney, said his client’s plea in the “cooperation agreement” pertained only to Carter’s death. A second-degree murder conviction carries a sentence of up to 15 years to life in prison, while Lampley and Alligood face potential life sentences without the possibility of parole.

“There will be no sentencing until the cooperation agreement is fully executed,” Bennett said.

Marin County District Attorney Edward Berberian, who opted not to pursue the death penalty in the case, said Angold will probably testify against Lampley and Alligood at a preliminary hearing set to begin May 9.

“This is something that has been under negotiation for a period of time,” Berberian said. “Both families of the murder victims were advised of this. They were fully informed as to what was developing and were fully aware of what was transpiring today. They have been very supportive of us moving forward in the way we need to move forward.”

Lokita Carter, the widow of Carter, said, “I trust that justice will be served to its fullest extent for these two unbearable and unforgivable murders, and that today's events will support this goal.”

Lampley, 23, Alligood, 18, and Angold were charged with the fatal shooting of Carey, a Canadian backpacker on her first solo trip, in San Francisco’s Golden Gate Park. Her body was found Oct. 3 during the second day of the Hardly Strictly Bluegrass Festival.

Two days later, Carter, a respected tantra teacher, was shot multiple times on a scenic fire trail in the Loma Alta Open Space Preserve near Fairfax. He was still clutching the leash of his Doberman pinscher, which was also shot but survived.

According to the charges, prosecutors believe Lampley was the gunman in Carter’s death, but it is still unclear who pulled the trigger in Carey’s killing.

The drifters were arrested outside a soup kitchen in Portland, Ore., after authorities said they tracked the three there using the GPS in Carter’s stolen station wagon. The defendants had the Smith & Wesson handgun used in both slayings in their possession, as well as Carey’s passport, airline tickets and camping gear, police said.

The gun was allegedly stolen from a car at San Francisco’s Fisherman’s Wharf on Oct. 1.

Amy Morton, an attorney for Alligood, did not immediately respond to requests for comment. Chief Deputy Public Defender David Brown, who is representing Lampley, said his office had not yet been given information on Angold’s plea deal.

“We will need to review this new development in Mr. Lampley’s case,” he said.

According to social media posts, Lampley and Alligood had a romantic relationship. Residents in the San Francisco’s Haight-Ashbury neighborhood said that in the weeks before the killings, the three had camped out in Buena Vista Park, blending in with the area’s transient population. They quickly developed a reputation for erratic behavior and methamphetamine use.

Lampley, who went by his middle name of Haze, has past convictions for theft and weapon possession, records show.

In a Facebook post in August, he listed each letter of the alphabet with a corresponding fact about himself. Next to the letter “H,” he wrote, “Hometown: San Francisco.” Next to the letter “I,” he wrote, “In love with,” with a link to Alligood’s profile.

Next to the letter “K,” he wrote, “Killed someone? Yea long time ago.”

Vivian Ho is a San Francisco Chronicle staff writer. Email: v ho @sfchronicle.com Twitter: @VivianHo