A probationer accused of sexually assaulting a 6-year-old boy in a Riverside public library bathroom was charged Wednesday with two counts of lewd acts on a child.

Juan Francisco Palacios, 29, was arrested Sunday following an investigation by Riverside police.

Palacios, who is being held in lieu of $1 million bail at the Robert Presley Jail in Riverside, is slated to make his initial court appearance Wednesday afternoon at the Riverside Hall of Justice.

According to Riverside Police Officer Ryan Railsback, the assault happened last Wednesday at the Duran Eastside Library in the 4000 block of Chicago Avenue. Railsback said the victim, whose identity was not released, was at the location with his father and headed into the bathroom alone just after 5 p.m.

Security surveillance video cameras recorded what transpired outside the restroom -- capturing Palacios as he loitered nearby and then ducked into the lavatory seconds after the child went inside, according to Railsback.

He alleged that the convicted felon cornered the boy and committed unspecified acts, then quickly exited the bathroom and the library, walking in the direction of a shopping center on University Avenue.

The child emerged moments later, telling his father what had occurred, prompting the man to call police, Railsback said.

Relying on the videotape, detectives from the police department's Sexual Assault Felony Enforcement Unit ultimately identified Palacios as the alleged perpetrator and began searching for the transient, investigators said.

About 3:30 p.m. Sunday, staff at the Riverside Main Public Library on Mission Inn Avenue spotted the probationer hanging around, recognized him as the alleged assailant described in law enforcement notices and called 911.

Palacios was taken into custody without a struggle a short time later, according to Railsback.

Court records show that the defendant has a prior conviction for possession of child porn.