Estancia High School went into lockdown Friday afternoon when a student's father allegedly brandished a BB gun during a fight with an administrator.

He became agitated after employees said he could not take his child because the family has an active restraining order against him, Newport-Mesa Unified School District spokeswoman Laura Boss said.

"It's difficult to tell a parent, 'You don't have rights to your child,'" she said.

The father began yelling at and pushing an assistant principal, Boss said, and the altercation spilled out of the administrative offices and into the hallway.

The scare began about 12:50 p.m. when a 35-year-old Costa Mesa resident allegedly pulled out a replica firearm and said he had a gun.

A security guard sprinted through the halls, warning students to hide or take cover behind desks, students said.

"I just hear yelling, 'There's a gun. There's a gun.' It kept progressing and getting louder and louder," sophomore Johnny Juarez said. "He ran by our class, and you could just see his face was pure fear."

School employees restrained the dad, and officers arrived within minutes to arrest him. The man was taken to the hospital for complaints of an injury, according to the Costa Mesa Police Department.

Criminal charges are pending, according to police.

Administrators lifted the lockdown by 1:30 p.m., and students were dismissed at their normal time, according to school officials.

There were no injuries other than minor ones to the assistant principal, Boss said.

"Everyone responded as they should when they should," said school board member David Brooks, who arrived at the scene after the incident.

Students said they and some teachers were initially in shock at the warning, remaining at desks or dismissing the screams as a drill.

Nellie McPherson and her classmates fled their ceramics class because there was no place to hide, the freshman said.

They took cover in a storage container on campus.

"The scary thing was it was outside and it's really easy to get to and it does not close at all," she said.

Newport-Mesa's school board approved new campus safety measures three days before the scare, spurred by December's school shooting in Newtown, Conn.

Part of the precautions include increased lockdown drills and a new curriculum teaching students to deal with armed intruders.

Estancia Principal Kirk Bauermeister said no students were in danger during the incident.

"School administration would like to commend staff, students and parents for their quick and calm response to this unfortunate situation," he said in a statement released to parents. "I will be reviewing this incident after the holiday recess with faculty and parent leadership; however, if you have any concerns in the meantime, please feel free to contact the school."

jeremiah.dobruck2@latimes.com; lauren.williams@latimes.com

Twitter: @TheDailyPilot