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.
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.
(Reporting by Mike Blake in San Diego; Additional reporting and writing by Steve Gorman in Los Angeles and Chris Michaud in New York; Editing by Paul Tait and Andrew Heavens)
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)