A former security guard who pleaded no contest to a series of attacks on sex-trade workers in and around South Los Angeles was sentenced this week to 30 years to life in prison.

Los Angeles Superior Court Judge Joel Wallenstein also ordered Ferdinand Ervin Flowers of Long Beach, 36, to register for the rest of his life as a sex offender.

Flowers entered his plea in September to two counts each of forcible oral copulation and assault with intent to commit forcible oral copulation involving attacks between May 2014 and September 2017.

Deputy District Attorney Frank Dunnick told City News Service the plea deal negotiated was “fair and represents the seriousness of the offenses committed by Mr. Flowers.”

The prosecutor noted the bravery of the victims and the violent nature of their assaults.

“It was a hard thing for these women to come forward,” Dunnick said.

Flowers was suspected of 13 gunpoint attacks on as many as 14 sex trade workers in the South Los Angeles area, authorities said.

He had a registered handgun and had been licensed as a security guard and used two vehicles in the assaults — a black Dodge pickup truck and a white Honda Civic. He would engage the women in conversation, get them into his vehicle and then take them to a remote industrial area and assault them at gunpoint.

Detectives conducting surveillance of the area arrested Flowers about 1:30 a.m. Jan. 12, 2018, after a 19-year-old woman got out of his car in a spot where he released other victims. The vehicle and his home were searched and a handgun was recovered, police said.

The prosecutor credited the hard work of the Los Angeles County Sheriff’s Department and the Los Angeles Police Department in seeing justice done and called out one detective in particular.

“Detective Dara Brown did an amazing job in this case,” Dunnick said.