A man who fatally shot two officers and wounded another in California has been taken into custody, according to police.
Palm Springs police chief Bryan Reyes said two officers trying to resolve a family dispute were killed on Saturday when a man they had been speaking to suddenly pulled out a gun and opened fire. A third officer was wounded and remains in hospital.
The Riverside County Sheriff's Department said that the "suspect has been taken into custody".
The police chief identified the killed officers as Jose "Gil" Gilbert Vega and Lesley Zerebny.
"It was a simple family disturbance and he elected to open fire on a few of the guardians of the city," he said.
Ms Zerebny, 27, had been with the department for about 18 months and only recently returned from maternity leave. She was the mother of a four-month-old daughter.
Mr Vega, a father of eight, was a 35-year veteran who planned to retire in December. He had been working overtime on his day off on Saturday.
Mr Reyes said the three were standing near the front door speaking with the man, "trying to negotiate with the suspect", when he suddenly shot them.
Riverside County SWAT officers quickly sealed off the normally quiet residential neighbourhood in the desert resort town as police evacuated some residents. They told others to stay inside their homes, keep their doors locked and not to open them for anyone until further notice.
A neighbour, Frances Serrano, said she called authorities after the father of the shooting suspect came to her house across the street and told her his son was "acting crazy".
"He said his wife left because she was so scared of him," Ms Serrano said, adding the father warned her that his son had threatened to shoot police if they arrived.
She had gone back inside her home before officers arrived, Ms Serrano said, and a few minutes after they got there she heard gunfire. Moments later officers were knocking on her door, warning her to stay inside.
Ms Serrano said the man police were looking for had been in jail at one time and had to wear a monitor on his ankle when he was first released. But she added that he had always been friendly and polite to her and her family.
"We never had any problems with him," she said.
Although Mr Reyes did not identify the shooting suspect, he indicated police had had previous dealings with him. He declined to elaborate, adding that Riverside County sheriff's deputies were now in charge of the investigation.
As the shooting scene remained locked down late into the evening, scores of police officers, several fighting back tears, gathered at Palm Springs Desert Regional Medical Centre to offer a salute as the bodies of Ms Zerebny and Mr Vega were placed into white hearses for transport to a coroner's office.
Meanwhile, in front of police headquarters, scores of local residents gathered to leave flowers and cards.
"I don't even remember anything so vicious and cruel," said Palm Springs resident Heidi Thompson. "These officers are responding to a domestic call for somebody in need that they don't even know. They put their life on the line for us, the community. And they get gunned down? I don't understand it."
The shooting occurred just three days after a popular Los Angeles County sheriff's sergeant was shot and killed in the desert town of Lancaster.
Sgt Steve Owen was answering a burglary call when sheriff's officials said he was shot by a man who then stood over him and shot him four more times.