The incident started as a carjacking outside a nail salon in San Bernardino, officials said.
Police initially started following the vehicle because of another motorist's report of spotting someone inside brandishing a weapon.
The suspect then released the woman who was driving the car and moved into the driver's seat himself and continued driving.
Officers chased the car for a short time, but because of the potential danger to the public from the suspect's erratic driving, police pulled off from the pursuit.
But then the suspect ditched the car at Arrowhead Regional Medical Center in Colton, walked across the street and stole a rental car from an Avis branch then took off again, officials said.
Police resumed the chase, but it ended on Cedar Avenue on the overpass above the 10 Freeway. The suspect barricaded himself in the stolen rental car as SWAT team negotiators tried to convince him to surrender.
After three hours after the standoff began, he gave up and surrendered to officers without further incident.
Barricade suspect has given himself up. pic.twitter.com/slKBjJO5we— Leticia Juarez (@ABC7Leticia) May 16, 2018