Hernandez fled the school and was last seen wearing a black T-shirt, jeans and a white hat and riding a bicycle. The female student alerted her teacher, and police were brought in to investigate.
School officials sent students home with letters to inform parents about the incident.
Covina undercover detectives, who were actively searching for the culprit, were able to track down Hernandez as he rode his bike in the area of Lake Ellen and Arrow Highway Tuesday morning.
At the time of booking, Hernandez identified himself with an alias of Cristian Jose Estrada Diaz from Covina, but his real identity was confirmed through fingerprints.
Hernandez, who is from Azusa, was booked on charges of attempting to contact a minor with lewd intent. His bail is set at $5,000.
Authorities believe there may be other victims. If you have any information regarding similar crimes, you're urged to contact the Covina Police Department at (626) 384-5808.
Do you want the Eyewitness News team to call you? Get a FREE Morning Wake-up Call and personalized weather report at abc7.com/wakeup