EUGENE, Ore. (AP) — Police fatally shot a man Friday who showed up with a gun at an Oregon middle school amid a custody dispute, but no one else was injured, authorities said.

The man was being escorted from Cascade Middle School in the city of Eugene when he began struggling and pulled out a gun, police Lt. Jennifer Bills told reporters. She initially said the shooting was inside the school.

"No students were harmed whatsoever. All the students are safe," she said.

Police asked parents to stay away from the school during the investigation.

By Friday afternoon, officers were escorting small groups of children to a church across the street where parents had gathered.

Yellow police tape was strung across the school’s main parking lot.

Parent Stephanie Martin waited for her two children at the church. She said her son, who is in sixth grade, called her to say he was OK and so was his sister, who is in the seventh grade.

“The kids are all safe, that’s all we know. But that’s all I care about,” Martin said. “It’s crazy, the world is crazy.”

More than 20 years ago, then-15-year-old Kip Kinkel killed his parents before fatally shooting two students and wounding 26 others at Thurston High School in nearby Springfield.

The incident was among the first school attacks in recent decades to seize the national spotlight, and predated prominent incidents around the country that have spurred a broader focus on school violence. Kinkel remains in prison.