An Oregon prosecutor has released intense video of a high school football coach who disarms and then hugs a student wielding a shotgun at a Portland school.

The incident took place May 17 at Parkrose High School, but the Multnomah County District Attorney's Office did not release the video until Friday. The release came days after court proceedings in the case were completed.

Keanon Lowe, who coaches football and track at the school as well as working as a security guard, was lauded as a hero after the incident. In the video, Lowe is seen emerging from a classroom, shotgun in hand, with the student. They then hug as Lowe hands the shotgun to someone who hustles it away from the scene.

Lowe recalled standing in the classroom when the student walked in with the weapon. Lowe said he lunged for the gun, seizing it as students fled out another door.

“Then it was just me and that student. It was a real emotional time," Lowe said in May. "I felt compassion for him. A lot of times, especially when you’re young, you don’t realize what you’re doing until it’s over."

3 mass shootings, 3 heroes:What makes some risk their lives for others?

Prosecutors say Angel Granados-Diaz, now 19, brought the loaded shotgun to school during what authorities have described as a mental health crisis. He pleaded guilty Oct. 10 to one count of unlawful possession of a firearm in a public building and one count of unlawful possession of a loaded firearm in public.

He was sentenced to three years' probation and is receiving treatment for mental health issues and substance abuse. Prosecutor Parakram Singh said the investigation revealed Granados-Diaz intended to harm only himself during the incident.

Lowe explained that he was called to the classroom to take a student to the counseling office, but was given no details. He was in the classroom for less than a minute when the student walked in with the gun.

School shooting ad: No child should have to text last words to mom

"A pretty crazy situation," he said. "In a fraction of a second, I analyzed everything really fast. I saw the look in his face, look in his eyes, looked at the gun, realized it was a real gun and then my instincts just took over."

Lowe said he grabbed for the gun with two hands, then turned it away from everyone as he wrestled it away. The two walked out together, and police arrived on the scene. Granados-Diaz was handcuffed and taken away.

"This is a story that usually ends in tragedy," said Lowe, who played football at the University of Oregon and worked as an assistant coach in the NFL. "From God's will, this ended up well. We were in the headlines, but it wasn't a tragedy. I am thankful for that."