PORTLAND, Ore. (AP) — A man was sentenced to five years in prison for punching a deputy district attorney while in court, according to the Multnomah County District Attorney’s Office.

Ryan Wayne Perkins, 32, pleaded guilty Friday to assault, escape, distributing a controlled substance – methamphetamine, attempted unlawful use of a vehicle, and robbery.

On Aug. 1, 2019, Perkins was in court after he stole a rental van while using a forged driver’s license, KPTV reported.

The district attorney’s office said during jury polling, Perkins stood up, ran past his attorney, and punched a Multnomah County Deputy District Attorney in the head several times.

A sheriff’s deputy used a stun gun on Perkins to gain control of the situation, according to the district attorney’s office.

The district attorney’s office said the attempted unlawful use of a vehicle, distribution of a controlled substance and robbery offenses that Perkins pleaded guilty to are for the previous criminal conduct.