PORTLAND, Ore. (KOIN) — A man who shot at four police officers during a traffic stop in NE Portland last year pleaded guilty to four charges on Monday, Multnomah County District Attorney Mike Schmidt announced.

Matthew Leahey, 37, pleaded guilty to two counts of attempted murder, one count of unlawful use of a weapon and one count of felon in possession of a firearm.

Portland police say on May 6, 2022, officers from the Focused Intervention Team conducted a traffic stop of Leahey’s vehicle around 9:15 p.m. for multiple violations at NE 78th Avenue and NE Mason Street.

After Leahey gave officers false information and wouldn’t present a driver’s license, one of the officers told Leahey to put his hands on his head while being seated in the car, according to PPB.

Instead of complying, Leahey pulled out a gun and shot at the officer, barely missing his head, authorities said. Leahey then left the car and raised the gun to fire at another officer before he was shot by police. He was then transported to the hospital by ambulance with life-threatening injuries.

No officers were injured in the shooting.

“This was an incredibly dangerous situation in a residential neighborhood where families live,” said PPB Deputy Chief Mike Frome. “I’m so grateful that the officers and community members are okay. It highlights not only the danger officers face each day as they work to keep the community safe, but underscores the importance of addressing our gun violence problem.”

Leahey is scheduled to be sentenced on Thursday.