A shootout that sent schoolchildren and pedestrians running for cover in San Francisco wounded one officer, the suspected gunman and four others, including a minor, police said.

Police Chief Bill Scott said at a news conference that officers were responding to reports of a man with a gun in the city's Outer Mission neighborhood on Wednesday afternoon.

Their investigation led to a nearby business, where Scott said officers "made contact with several individuals ... and shots were exchanged."

One officer and five others were shot, including the gunman who fired on police.

The officer is in fair condition with a non-life-threatening gunshot wound to his leg, police and hospital officials said.

Of four men who were shot, one is in critical condition, another is in serious condition and two others are in fair condition.

San Francisco General Hospital spokesman Brent Andrew declined to release the status of a minor who was hit by gunfire, citing their age.

Police declined to answer any further questions about the shootout, which witnesses described as terrifying.

"It was intense — everybody was trying to get away," Malashia Buckner told The San Francisco Chronicle. "A lot of people and kids were running from the scene."

Another witness, Ed Nasrah, told the Chronicle that he was in the back of his pharmacy with customers when he heard what sounded like at least 20 rounds fired.

"We have had shootings before but never in broad daylight or during business hours," he said. "It was scary, the way it happened."

Nasrah said the scene was chaotic, with people diving behind cars and children crying. One man who'd been shot was dragged into the pharmacy, he said.

"The guy was screaming in agony 'I got shot, I got shot,'" Nasrah said. "Everyone was running and ducking for cover. Two kids were screaming outside the barbershop because they didn't know if their father was OK."