EUGENE, Oregon — Authorities have released the name of the suspect who was shot and killed by police after pulling out a gun following a custodial dispute at Cascade Middle School on Friday.

The school was placed into lockout for most of the day. All students, staff and officers were safe and unharmed, police said.

Shortly before 10:30 a.m., Eugene police were called about the custodial dispute at the school. As officers were escorting the suspect, identified as Charles Frederick Landeros, 30, of Eugene, outside, "Landeros produced a firearm and a struggle ensued," police said. During the struggle, Landeros was shot by police and killed. The shooting occurred outside the school.

RELATED: Man shot, killed by police outside Eugene middle school was former student activist

An investigation is ongoing.

"Everyone started to go into panic mode, and they shut the curtains down and all went into a corner," said student Shaylyn Rivera. "A lot of people were having anxiety, they were, like, shaking."

Daysen Kensler, a sixth grade student, was in band class when the shooting happened.

"As soon as we sat down they just came on the loud speaker and said this is a lockdown and that there was a shooter," Kensler said.

"It was just scary because it was like you never knew when they were going to come on the loud speaker again," Kensler said.

"I was scared. I was really nervous," said student Mary Orozco. "I had to pinch myself. Everyone was in shock."

At the request of police, school continued through 3 p.m., the usual dismissal time. Some children were picked up by their parents at a nearby church before the end of the school day. But many students were released at 3 p.m. through side exits.

Watch: Parents hug, reunite with children

News of the shooting was shocking for parents.

"This isn't just stuff you see on the news. This is Cascade Middle School in Eugene, Oregon," said mother Nicole Teeter.

Latest information from Bethel School District website

KGW made an effort to get approval from parents before conducting interviews with students.