The Riverside County Sheriff's Department identified the suspect as 26-year-old John Felix of Palm Springs.
Palm Springs Police Chief Bryan Reyes said a woman called police at about 12:18 p.m. on Saturday to report that her son was causing a disturbance in the 2700 block of Cypress Road.
According to authorities, four officers arrived at the scene and Felix would not open the door to the home, threatening to shoot the officers.
PHOTOS: 2 officers killed, 1 injured in Palm Springs shooting
Felix suddenly pulled out a gun and opened fire, Reyes stated.
A witness at the scene said he heard at least 100 shots erupt and saw three to four officers attempting to revive an officer.
A third officer was also wounded in the shooting. Reyes said the officer was alert and providing investigators with more information on the situation.
Reyes identified the two officers who were killed as Officer Jose Gilbert Vega and Officer Lesley Zerebny.
Vega, 63, was a 35-year veteran at the police department and was due to retire in December. Reyes said he had been working overtime on an unscheduled shift. Vega was also married and a father of eight.
Zerebny, 27, had been with the department for about 18 months. Reyes said she had given birth to a child about four months ago and had just returned to work. She was married to a Riverside County sheriff's deputy.
SWAT officers surrounded the home after Felix barricaded himself in as the quiet neighborhood was sealed off. Several residents in the area were evacuated due to the situation.
Authorities used robots to breach the front door of the home and later announced Felix was in custody about 12 hours after the initial shootings.
Felix suffered non-life threatening injuries and was taken to the hospital. Authorities said Felix would be booked on two counts of murder on a peace officer.
Police robot just rolled right past media and into scene. One of the strangest things I've ever seen. pic.twitter.com/FgbHKiTiag— Greg Lee (@abc7greg) October 9, 2016
Reyes had indicated the suspect had previous dealings with police.
The Associated Press contributed to this report.