A Fountain Valley man who was a former U.S. Customs and Border Protection officer was convicted Tuesday and sentenced to six years in state prison for raping two women, according to the Orange County District Attorney’s office.

Miguel Lerma Jr., 33 pleaded guilty to a felony charge of forcible rape and rape of an intoxicated person.

The defendant was also sentenced to lifetime registration as a sex offender, barring him from entering county recreational areas and city parks.

At the time of the attacks, Lerma worked as an officer for U.S. Customs and Border Protection with the Department of Homeland Security.

The first rape took place on Sept. 10, 2009 where he met an intoxicated Long Beach resident who was out drinking with a friend.

The victim, who didn’t know Lerma beforehand, blacked out and found herself in the bushes.

She then reported the rape but police made no arrests until after a second rape was reported.

On Nov. 14, 2010, Lerma picked up a prostitute and drove to an industrial area in Garden Grove.

The second victim became scared and tried to escape from Lerma’s vehicle, but the defendant forcibly raped her.

After she reported the rape to Garden Grove police, authorities matched the DNA provided by Lerma in that case to the DNA found at the crime scene in Long Beach.

anthonyclark.carpio@latimes.com

Twitter: @acocarpio