WASHINGTON - Milwaukee was on edge Sunday after angry crowds took to the streets of the midwestern US city to protest a deadly police shooting, throwing rocks at officers and torching buildings.

The latest violence comes after several police officers have been targeted and shot to death across the nation in recent weeks amid a nationwide outcry over the deaths of unarmed African Americans at the hands of police.

Police said they tried to disperse the crowd of at least 200 protesters. Shots were fired, apparently in the air.

One officer was hospitalized after a brick was thrown through a squad car window, striking the officer in the head.

Protesters also set fire to a gas station.

The fire department "cannot extinguish fire as gunshots are being fired," the Milwaukee police force said in a tweet. Around midnight, firefighters were able to reach the scene and work on extinguishing the blaze.

Police said crowds also broke the windows of an unoccupied squad car and torched another.

At least three people were arrested.

The earlier shooting, which had grisly echoes of a series of violent events involving law enforcement in recent months, began in the afternoon, when two police officers had stopped two suspects in the car who then fled on foot.

"During the foot pursuit, one officer shot one suspect, armed with a semiautomatic handgun" who then died at the scene, the Milwaukee Police Department said in a statement.

It described the suspect who was killed as a 23-year-old local with a "lengthy arrest record," adding that the handgun he was carrying had been stolen during a burglary in March.

The ensuing confrontation with police officers also saw protesters start fires at other businesses, including a bank branch, a beauty supply company and an auto parts store, the Milwaukee Journal Sentinel reported.

"There are a lot of really, really good people who live in this area, in the Sherman Park area, who can't stand, just like any of us, who can't stand this violence and they want order restored," Mayor Tom Barrett told reporters, as he pleaded for calm.

"Our police officers are doing everything they can right now to restore order. We have lots and lots of police officers there."

The United States has been on edge for weeks following shootings of police officers in Dallas and Baton Rouge, Louisiana.

Those attacks followed anger among the black community over the shooting deaths of African-American suspects by white police in Minnesota and Louisiana.

Local official Khalif Rainey, who represents the area where the disturbances took place, called the violence a "warning cry."

"This entire community has sat back and witnessed how Milwaukee, Wisconsin, has become the worst place to live for African Americans in the entire country," he was quoted as saying.