Police fatally shot a man involved in a custodial dispute at a Eugene middle school Friday morning.

Eugene police said the man produced a gun while they were escorting him from Cascade Middle School and that a struggle ensued. Police said they shot and killed the man during the struggle.

The fatal shooting happened outside the school. No students, staff or police officers were hurt.

Students will stay in school for the remainder of the day, the school said. They will be released through the school’s side exits at 3 p.m. Students who are usually picked up from school can meet parents or guardians at a nearby church.

The school is still under a lockout. School officials urge the public not to call — or come to — the school.

Police initially responded there about 10:30 a.m. They remained on scene three hours later.

Police didn’t say how many officers fired their weapons, how many shots were fired or how many times the man was hit.

They haven’t publicly identified the officer or officers involved in the shooting or the man who was killed.

Gov. Kate Brown issued a statement on the incident Friday.

“Gun violence is never acceptable, but in our schools it is a tragedy and a travesty," she said. "Everyone deserves to be free of the fear of gun violence, and for our children to grow and thrive, our schools must be safe. An Oregon State Police investigation is ongoing, and as such it’s not appropriate for me to comment on any particulars of a case.”

Cascade Middle School, which is part of the Bethel School District, serves students in sixth through eighth grades. It had an enrollment of 330 in 2017.

— Jim Ryan; jryan@oregonian.com; 503-221-8005; @Jimryan015

Visit subscription.oregonlive.com/newsletters to get Oregonian/OregonLive journalism delivered to your email inbox.