LOS ANGELES (CBSLA) — Two disgraced Los Angeles police officers accused of repeatedly raping several women while on duty pleaded no contest Monday and were sentenced 25-year prison terms.

James Christopher Nichols, 46, and Luis Gustavo Valenzuela, 45, entered a plea to two counts each of forcible rape and forcible oral copulation.

READ MORE: LAPD Says Armed Robberies Have Become An Alarming Trend

“Prior to being a judge, over 33 years ago, I was in law enforcement as a member of the DA’s office and head of organized crime,” said Los Angeles Superior Court Judge Ronald S. Coen to the former cops while in court. “This hurts.”

Nichols and Valenzuela accepted plea deals and 25-year prison terms to avoid a trial and the possibility of life behind bars. The men were also ordered to register as lifetime sex offenders.

The two worked together in the LAPD’s Hollywood Division as partners.

According to prosecutors, between 2008 and 2011, Nichols and Valenzuela assaulted four women, ranging in age from 19 to 34-years-old.

The victims were all involved in drug-related offenses when they were assaulted. At least one of the victims acted as a criminal informant for the police.

READ MORE: Hiring Crisis At Pechanga Resort And Casino Causes Management To Offer Big Bonuses To Potential Employees

The women accused the officers of pressuring them to perform sex acts to avoid going to jail, saying they were attacked in alleys, apartments and the officers’ patrol car.

One victim claimed that she was sexually assaulted on four separate twice by Nichols, once by Valenzuela and once by both of the officers, all taking place over a period of about 18 months.

Another woman accused Valenzuela of assaulted her with a gun.

After the plea deal was accepted, a deputy DA called the crimes ‘particularly heinous’ because of the authority officers have when they put on their badge.

Since being arrested in February 2016, both Nichols and Valenzuela have remained in jail.

Three of the four women involved have already received civil settlements from the city in the amounts of $450,000, $575,000 and $750,000.

MORE NEWS: Pack Of Unleashed Cane Corso Mastiff Dogs Attack Residents In Tarzana Neighborhood

(©2018 CBS Local Media, a division of CBS Radio Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. Wire services contributed to this report.)