A woman was shot and killed when a gunman ran into a Los Angeles supermarket where he held dozens of people hostage for about three hours on Saturday before handcuffing himself and surrendering to police.

About two hours before taking the hostages, police say the man shot his grandmother seven times and wounded another woman whom he forced into a car. Police chased the vehicle and exchanged gunfire with the man, who crashed into a pole outside Trader Joe’s in the city’s Silver Lake suburb and ran into the store.

Customers and workers dove for cover as police bullets fired at the suspect shattered the store’s glass doors. Some inside the supermarket climbed out windows as scores of police and firefighters and 18 ambulances converged on the scene.

'No Notoriety': the campaign to focus on shooting victims, not killers Read more

Heavily armed officers in riot gear stood along the side of the store and used mirrors to look inside as hostage negotiators tried to coax the man into freeing his 40 to 50 hostages and surrendering.

About three hours later at 6.30pm the man agreed to handcuff himself and walked out the front door surrounded by four of the hostages. The unidentified man, who police said was about 28, was immediately taken into custody. Police said he had a wound to his arm.

Mayor Eric Garcetti congratulated police and firefighters for their work and mourned the loss of life at the Trader Joe’s he and his wife regularly shopped at when they lived in the neighbourhood. “The heroism that was shown today was second to none and the teams that were able to respond, secure the perimeter and engage in conversation with the suspect no doubt saved lives today,” he said, adding “our hearts go out to everyone who has been traumatized.”

The hostage situation began around 1.30pm when the suspect shot his grandmother and another woman in south Los Angeles and then forced the other woman into his grandmother’s car, Los Angeles police chief Michel Moore said. The grandmother was in critical condition.

Officers tracked the car and tried to stop it in Hollywood but the man refused to pull over, Moore said. During the chase he suspect fired at officers, shooting out the back window of his car, before he crashed.

Outside the store the man exchanged gunfire with police again and a woman was shot and killed, Moore said. It was not clear if she died from police gunfire or was killed by the gunman.

Fire officials said six other people ranging from 12 to 81 years old were taken to hospital. None had been shot and all were in fair condition.