BEIJING - A man armed with a knife stormed a police station in Shanghai on Tuesday, stabbing officers inside and killing at least five, authorities said.

The 28-year-old man, whose surname is Yang, set a fire outside the building's gate and then rushed inside and began attacking officers, the Shanghai public security bureau said in a news release.

Five officers died after being taken to a hospital, while four other police officers and a security guard were hurt, the statement said. Some had chest wounds and others had bloodied faces, the official Xinhua News Agency reported, citing a witness with the surname Yi.

Yang, who is from Beijing and unemployed, said he was seeking revenge after officers at the station in Shanghai's Zhabei district investigated him last year for allegedly stealing bicycles, police said.

Yang was taken into custody at the station.

Violent street crime is rare in China, where private gun ownership is virtually banned.