A 35-year-old man was shot dead when he allegedly battered an ambulance medic and then stabbed an officer with a butcher knife, authorities said.

The 35-year-old man who was just released from Twin Towers jail in downtown Los Angeles jumped out of a moving ambulance, hid out in a church and then stabbed a police officer before police shot and killed him, Fox news reported quoting police officials.

The man, who was shot dead, was not identified by police and at about 2.30 p.m. he was transported to Los Angeles County/USC Medical Center.

Police spokeswoman Norma Eisenman said that the man was freed on Saturday afternoon and attacked medics taking him to a hospital in a private ambulance.

Commander Andrew Smith told the Los Angeles Times that the man jumped out of the moving ambulance in Boyle Heights, and ran into the El Divino Salvador
Presbyterian Church on Echandia Street.

When police officials with a police dog started searching the church, the man jumped on one of the officials and stabbed him with the 8-inch knife on his left bicep,
Smith added.

Smith also added that police opened fire at the man and killed him.

The officer who was injured in the attack was taken to Los Angeles County/USC Medical Center.