A Glendale pastor suspected of forcing his way into a Covina hotel room and sexually assaulting a girl visiting from China pleaded no contest to a charge against him Monday and was immediately sentenced to six years in state prison.

Douglas Rivera, 40, of Baldwin Park, was initially arrested Feb. 11, 2018, after he turned himself in to authorities.

Prosecutors said Rivera drove to a hotel room on the 1200 block of East Garvey Street in Covina four days earlier, entered one of the hotel rooms and inappropriately touched one of the two girls who were staying there.

Covina Police alleged Rivera arrived at the motel shortly after 8 p.m. and parked his pickup truck facing the open window of a motel room occupied by two girls between 10 and 13 years old, who were visiting the U.S. on a school trip from Hangzhou, China.

He masturbated and stared at the girls for more than 30 minutes before knocking on the door, forcing his way inside, sexually assaulting one of the girls and then fleeing, according to authorities.

Rivera initially pleaded not guilty to charges of first-degree burglary, indecent exposure and lewd acts upon a child in April 2018. On Monday he pleaded no contest to one felony count of lewd act upon a child.

Rivera will need to register as a sex offender for the rest of his life, Los Angeles County prosecutors said.

Rivera was quickly identified as a suspect after police released surveillance images of the attacker and numerous church members and associates recognized him as the pastor of the God’s Gypsy Christian Church in Los Angeles, police said.