One witness said the gunman "was sitting there with a beer in one hand and a gun in the other"
The rampage in University City, near La Jolla, unfolded at an upscale apartment complex where apartments rent for $4,000 a month.
More than two dozen people were gathered there for a 50th birthday party when chaos erupted.
In video of the incident, people can be seen running for their lives as one wounded woman is being carried away.
Resident Rikki Galliendes, who recorded the drama from his balcony, spoke to Inside Edition: "We saw this guy come up, he had blood on his shirt, my roommate grabbed me and said, 'Be careful, put your head down, that guy over there has a gun.' I looked over and saw he had a gun in his lap."
The gunman, identified as Peter Selis, was heard telling people, "You can leave or stay here and die." He was later shot and killed by responding police officers.
His motive is not known, but all of his victims were black or Hispanic. Selis, a 49-year-old former auto mechanic at a San Diego Ford dealership, was white.
“This is truly a horrific act of violence that took place here today,” San Diego Mayor Kevin Faulconer said at news conference following the incident. “Our entire city, all of our thoughts and prayers, all San Diegans’ thoughts and prayers, are with the victims and their families tonight.”