CLEARFIELD — Both directions of I-15 were closed in Clearfield during rush hour Monday evening while police negotiated with a man who walked onto the freeway median and pointed a gun at himself, Utah Highway Patrol said.

The man was eventually taken into custody with minor injuries after nearly four hours, officials said.

The incident began Monday afternoon when police were investigating a crash and pedestrians let them know about a man who was standing on a freeway off-ramp and acting suspiciously, Utah Highway Patrol Sgt. Nick Street said.

When police approached the man, he held a gun to his head and didn't obey officers' commands, Street said.

The man started to walk up an off-ramp and onto the freeway median, Street said. The UHP's Special Emergency Response Team was called to help negotiate with the man.

During the incident, he did not point his gun at anybody else, the sergeant said.

However, negotiations with the man were unsuccessful and police eventually subdued him with a pepper-spray projectile, Street said.

During the incident, the freeway was shut down from northbound 700 South to 5600 South in Roy and southbound 5600 South in Roy to 700 South in Clearfield, Clearfield City tweeted.

A long line of cars was backed up at a standstill in both directions of the freeway before the road reopened around 9 p.m.

Videos submitted from bystanders at the scene showed a man walking around on the freeway while police moved in around him.

Paigelynn Magnusson, who was in the area at the time when police arrived, said from a distance she saw the man "pacing back and forth, jumping around, having very large movements. … He was unpredictable."

She said she was worried for her and her siblings' safety.

Christopher Scott Lewis, 35, of Grantsville, was booked into the Davis County Jail Monday night and will likely face "numerous criminal charges" connected to the incident, Street said.

Court records show he has accumulated a number of criminal charges since 2002, including aggravated arson, aggravated robbery, attempted theft and escape from official custody, among others.