SAN DIEGO (Reuters) - A man holding a gun in one hand and a bottle of beer in the other opened fire on people around a swimming pool in a San Diego apartment complex, killing one and injuring others before police shot him dead on Sunday, media said.

The gunman launched his attack during a birthday celebration in the complex in the city’s University City section, NBC News’ San Diego affiliate reported.

One resident, who identified himself as John, told KFMB-TV he saw the gunman “sitting, drinking a beer in one hand with a gun out in the other” in the pool area.

He said he and his wife saw “three people laying on the ground shot” and one wounded victim trying to crawl to another to give assistance.

Two police officers arrived and confronted the gunman, who exchanged gunfire with the officers before he was shot, the witness said. Some of the victims were taken away in cars to hospital before paramedics made it to the scene.

The gunman was killed after pointing his weapon at police, San Diego Police Chief Shelley Zimmerman told reporters. She did not identify the suspect or mention a possible motive.

Eight people were injured when the shooting broke out just after 6 p.m. local time (0100 GMT Monday), Zimmerman said, several of them left in a critical condition.

Media including NBC’s affiliate and CNN, citing Zimmerman, reported late Sunday night that a female victim had died. Media reports said the gunman was a resident of the complex.