SANTA ANA (AP) — An Orange County man charged with shooting and killing his ex-wife and seven others at a hair salon has agreed to plead guilty, his defense attorney said Monday.

Scott Dekraai, 44, had been locked in a custody dispute with his ex-wife over their-8-year-old son before he strapped on a bulletproof vest, took three guns and entered Salon Meritage in 2011, police said.

He is accused of shooting his ex-wife, a hairdresser, before killing the Seal Beach salon’s owner and six others.

Eight people were shot inside the salon, and all but one died. A man sitting in his car in the parking lot was also gunned down.

Minutes later, Dekraai was stopped by police and arrested.

He told the officer “‘I know what I did,'” according to police.

Defense lawyer Scott Sanders told an Orange County court during a hearing Monday that his client would enter the plea.

Dekraai, a former tugboat operator who lived in nearby Huntington Beach, had previously offered to plead guilty in exchange for multiple life sentences but prosecutors refused to drop the death penalty from consideration.

Dekraai’s trial was scheduled to start June 9.

Sanders, an assistant public defender, wants to have the death penalty tossed out and to have the district attorney’s office recuse itself because of recordings made by a fellow inmate that prosecutors characterized as Dekraai bragging about the killings. The district attorney’s office agreed last week to drop efforts to use the recordings in court proceedings.

The salon reopened about a year after the shootings that rocked the sleepy beach city. Six of the original employees, including the owner’s widow, returned to work.

For more than two years, relatives of the victims have trekked to the Orange County courthouse in Santa Ana for hearings on the case.

Paul Caoette of Costa Mesa, whose father David was gunned down as he sat in his car outside the salon, welcomed the idea of a plea.

“I think he should admit his guilt,” Caouette said. “Every single thing he has done is cowardly.

“We’re a capital punishment state. If anybody deserves the death penalty, it’s Dekraai.”