An armed man held off police in a busy section of downtown Long Beach during the afternoon rush hour Wednesday, but was subdued by a police dog on live television.

A man with a gun was spotted at about 3:55 p.m. in a white van on Ocean Boulevard, prompting the street to be closed to vehicle traffic and pedestrians between Magnolia and Pine avenues, police said.

A SWAT team was activated and a negotiator was speaking with the suspect, police say.

"Once we saw all the police cars come in, we knew something was going on," city employee Jennifer Carey said.

Long Beach City Hall was placed on lockdown. Mayor Robert Garcia said via Twitter that everyone in the building was safe.

We have a barricaded suspect with a gun near City Hall. Police are on the scene. City Hall is on lockdown and everyone in the building is safe. I’m here at City Hall with the team. Please stay away from Ocean and Magnolia. — Robert Garcia (@RobertGarciaLB) March 8, 2018

Police were escorting city employees out of the building shortly after 5 p.m., Garcia tweeted.

"We are on site, and again everyone is safe," Garcia wrote.

Aerial television pictures showed an armored truck straddling Ocean Boulevard, with a man sitting inside a nearby white vehicle.

A woman had warned that her husband was armed with guns in front of the Federal Building, which is at 501 W. Ocean Blvd.

A few moments after 6 p.m., a police dog was seen subduing the suspect, and he was arrested.

The man later died at a hospital, police said. Police confirmed they fired non-lethal rounds at him first and then gunshots.