Image copyright CBS

Police say a man called his ex-girlfriend on the phone as he shot seven people at a pool party on Sunday.

Peter Selis, 49, was depressed about the break-up and did not target his victims, who were black and Hispanic.

"These victims were just in his presence at the wrong place at the wrong time," said San Diego Police Chief Shelley Zimmerman, ruling out race as a factor in the attack.

Selis killed one and injured six others before being shot dead by police.

Officers responded to reports of a shooting at about 18:00 local time at the upmarket La Jolla Crossroads apartments.

Mr Selis was sitting beside the pool, which was in the same apartment complex where he lived.

From his lounge chair he began opening fire on the group, say police. After shooting two people, he placed a call to his ex-girlfriend.

"It is apparent that Selis wanted his ex-girlfriend to listen in as he carried out his rampage," said Mrs Zimmerman.

Selis, who has no known criminal history, continued to speak as he fired on the crowd while they scrambled to flee the pool area.

A police helicopter observed him reloading his .45 caliber handgun while still inside the pool area.

Moments later police on the ground shot him dead, after he raised his gun to fire on them.

Image copyright CBS Image caption Pool-goers waited for information outside the apartment complex

In the days before the attack, Selis and his girlfriend had ended their relationship.

His family said he was "distraught and depressed", police said, but they had no indication that he would resort to violence.

"Based on the information we have gathered so far... it is very clear that Selis was very despondent over the break up of his girlfriend," said Mrs Zimmerman.

One witness told KFMB-TV that Selis appeared to be drinking a beer during the gunfire, however, police did not confirm that detail.

Another witness said Selis sat in a lawn chair during the incident, and was "telling people to leave".

Image copyright CBS

Police do not believe Selis knew any of the roughly 30 people at the party.

Selis is white and his victims were four black women, two black men and a Hispanic man, but police have ruled out a hate crime.

He was a resident of the same block of flats, where monthly rent ranges between $1,750 and $4,000.

According to US media, Selis filed for bankruptcy in 2015.

He listed his occupation as a car mechanic in court documents, and said he had two children and a stepson.