A 49-year-old San Diego man, apparently distraught over a recent breakup, fired a gun while on a cellphone with his ex-girlfriend on Sunday, killing one person and injuring at least six at a poolside party before the police shot and killed him, the authorities said.

The attack took place around 6 p.m. as people gathered around the pool for a birthday party at the La Jolla Crossroads complex in University City, near the University of California’s campus in the northwest part of the city.

At a news conference on Monday, Police Chief Shelley Zimmerman said the suspect, Peter Selis, who lived at the complex, was “distraught, depressed” when he opened fire.

“It is apparent that Selis wanted his girlfriend to listen in as he carried out his rampage,” she said.