They had been attempting to resolve a family dispute when a man they had been speaking calmly to suddenly opened fire, according to police chief Bryan Reyes.
Specialist firearms teams had surrounded the property and people were warned not to stream live video of officers' movements on social media, as it could put them in danger.
A neighbour, Frances Serrano, said she had alerted the authorities after the father of the suspect came to her home and told her his son was "acting crazy".
She said the father had warned his son had threatened to shoot police if they arrived.
Lesley Zerebny had returned to work after maternity leave. Pic: Palm Springs Police
Image Caption: Lesley Zerebny had returned to work after maternity leave. Pic: Palm Springs Police
The dead officers have been named as Jose "Gil" Vega and 27-year-old Lesley Zerebny.
Officer Zerebny only recently returned to the force from maternity leave after giving birth to a now four-month-old daughter.
Officer Vega, a father of eight, was a 35-year veteran of the Palm Springs force and was due to retire in December.
Jose Vega was due to retire from his long career. Pic: Palm Springs Police
Image Caption: Jose Vega was due to retire from his long career. Pic: Palm Springs Police
The Riverside County Sheriff's Department has identified the man suspected of the shootings as John Felix, adding that he surrendered peacefully to police after a lengthy stand-off.
Felix is a 26-year-old resident of Palm Springs and was treated in hospital for non-life-threatening injuries after the incident.
He will be charged with two counts of murdering a peace officer, authorities said.
A peace officer is an American term for a civil officer appointed to preserve law and order, such as a sheriff or police officer.
Palm Springs Police officers salute the bodies of two officers shot earlier in the day in Palm Springs, California
Image Caption: Palm Springs police officers salute the bodies of the two officers
The Desert Sun newspaper reported that court documents show John Hernandez Felix was jailed for four years for an attempted gangland killing in 2009.
He and another suspect shot their target but did not kill him, an incident that resulted in charges of attempted murder, discharging a firearm causing great bodily injury and association with a criminal street gang.
Court records show that Felix eventually admitted assault with a firearm and his gang connection.
His prison sentence would have ended in 2013.
Also in 2013, he was also the subject of a forceful arrest on the same doorstep where this weekend's shooting occurred, the newspaper added.
The deaths of Officers Vega and Zerebny come just days after a Los Angeles County sheriff's sergeant was shot and killed in the desert town of Lancaster, California.