An armed man who hijacked a UPS truck tried to run from a tense, hourslong standoff with police in San Jose but was fatally shot Thursday, after he led Santa Clara County sheriff's deputies on a chase through the area.

The chase began about 5:15 p.m. at Chynoweth and Pearl avenues with the suspect, later identified by friends as Mark Morasky, seen driving an SUV, sheriff's officials said. Authorities said Morasky shot at deputies during the pursuit.

Raw video of the moment a suspect in a San Jose standoff exits a UPS truck and flees on foot.

At some point, Morasky hijacked the UPS truck, with the driver inside, and the chase continued along Highway 87 through downtown San Jose, turning into a standoff and hostage situation on North First Street and Trimble Road.

The truck came to a halt on First Street after a spike strip blew one tire. The truck was immediately surrounded by at least two dozen police cars.

A woman later exited the vehicle and was taken into custody. Small crowds gathered around the cordoned-off area and traffic was backed up as police patrols rerouted drivers.

The UPS driver was seen being released to authorities around 6:15 p.m. Morasky later exited the truck and fled on foot carrying a shotgun before he was shot. San Jose police late Thursday night confirmed he died at the scene.

Sheriff's deputies and police chase a UPS truck through San Jose. The pursuit eventually turned into a standoff on North First Street.

Several of Morasky's friends had been talking with him on the phone, trying to calm the situation.

"He was scared," friend Amanda Bazzani said. "He called me and said, 'I love you, I'm in a standoff.' And then he was saying goodbye, and I was like, 'No, no, don't say that.'"

The UPS driver was not hurt, nor were any officers, the sheriff's office said, adding that more details would be provided Friday.

North First Street was shut down in both directions during the standoff and will remain closed through the night as authorities investigated the scene, sheriff's officials said.

VTA light rail services also stopped indefinitely between the Karina and Tasman stations.