A man threatening to jump from an overpass edge onto Interstate 5 was safely detained Friday night, allowing the freeway to be reopened after a more than eight-hour closure.

The incident was first reported around 11:40 a.m. on the Del Mar Heights Road overpass, according to online California Highway Patrol logs.

A SigAlert was issued early in the afternoon, and the northbound freeway lanes and the overpass were shut down by 12:30 p.m., according to CalTrans. The southbound lanes also closed intermittently, due to the man running back and forth along the overpass railing over both sides of traffic, according to the log.

Crisis negotiators were called to the scene. Firefighters had a ladder truck reaching up to the overpass, as well as what appeared to be a large cushion underneath in the northbound lanes.

The San Diego Police Department, which responded to the scene, told commuters on social media to expect “significant traffic delays … for the time being.”

Commuters stuck in traffic reported that they had gone only a handful of miles over the course of three hours Friday afternoon. Many drivers were seen staring at their phones or trying to find freeway exits that were already jammed with traffic.

The traffic jam spread onto surface streets and other freeways, already congested during the afternoon rush hour, adding several hours onto many people’s commutes.

Around 8 p.m., the man was safely taken off the bridge, and officials began to reopen lanes, according to San Diego police Officer Jose Perales. The man will be kept on a mental health hold.