Long Beach police this week arrested a man who they say pointed a gun at a student on an elementary school campus.

Officers were dispatched to McKinley Elementary School in North Long Beach around 1:15 p.m. Wednesday after someone reported a man with a gun, Long Beach Police Department spokesperson Eric Stachura said in an email Friday.

An 8-year-old girl told police that while she was in the schoolyard, “a male adult suspect, standing outside the campus, pointed a firearm at her from the other side of a fence,” according to the email.

The girl ran away unharmed, and the man fled, but he was found by police near the 6700 block of Paramount Avenue, according to Stachura. He said officers arrested Gerardo Perez, 38, of Bellflower, but didn’t find a weapon.

Perez had a previous warrant and was arrested on suspicion of assault with a firearm, illegally having ammunition and drug paraphernalia, and obstructing an officer, Stachura’s email said. Bail was not granted.

The school was locked down for about an hour on Wednesday as a precaution, and parents were notified, a Long Beach Unified School District spokesperson confirmed.

Police did not immediately respond to questions about whether the man knew the girl or what motive he may have had for pointing a gun at her.