Felix, 26, was captured alive around 12:50 a.m. Sunday morning after a standoff with police lasting 12 hours, according to the Riverside County Sheriff's Department. He is accused of two counts of murder of a peace officer.

Felix was previously sentenced to four years in prison for a 2009 attempted murder plot in which he confessed to assault with a firearm. Felix and another suspect managed to shoot their target but he didn't die. Felix was charged with attempted murder, discharging a firearm causing great bodily injury and association with a criminal street gang.

He was also arrested in 2013 for fighting with police on the same doorstep where Saturday’s shooting occurred.

Authorities say Felix killed officers Jose Gilbert “Gil” Vega and Lesley Zerebny Saturday in what witnesses described as a barrage of gunfire — the first Palm Springs officers to die in the line of duty since 1962.

Court records don't provide details of the 2009 shooting, but they do show that Felix pleaded down to assault with a firearm and admitted his gang connection. He was given a two year prison sentence for the assault and an additional two years for his gang ties. His prison term would have expired in 2013.

Vega was a 35-year veteran who chose to work an overtime shift on Saturday, Palm Springs Police Chief Bryan Reyes said in a news conference. Vega was two months away from retirement.

Zerebny, 27, had been with the department for a year and a half. She had just given birth to a baby girl four months ago.

"Today Palm Springs lost two brave officers," Reyes said, his voice shaking with emotion. "I am awake in a nightmare right now."

Gov. Jerry Brown said in a statement that the officers "were killed today doing what they do every day – protecting their community."

"We grieve with the family members, friends and fellow officers coping with this senseless tragedy," Brown said. "Anne and I join all Californians in offering our heartfelt condolences.”

Officers comfort each other after the bodies of two killed Palm Springs police officers, Leslie Zredman and Jose Vega, are carried out of Desert Regional Medical Center, October 8, 2016.
(Photo: Zoe Meyers/The Desert Sun)

'They gave it all for you'

The shooting plunged Palm Springs into mourning and set off a hunt for the gunman. Investigators were at the scene of the shooting after midnight, calling for the suspect to come out of the house where they believe he took refuge.

Frances Serrano, who lives directly across the street from where the shooting took place Saturday, spoke to the father of the suspected gunman moments before the bloodshed. The father told Serrano that his son had a gun and wanted to shoot police officers.

“He came over and asked for help,” she said.

Serrano called the police and the father walked back toward his house. Soon after, Serrano said, she heard gunshots.

The officers responded to a report of a domestic disturbance at 12:18 p.m. and were at the door of a house when the shooting began, the police chief said.

Neighbors said police had previously been called to a similar domestic disturbance at the house about a week ago.

Emergency personnel attend to what appears to be a victim of a gun shot wound on the corner of Cypress Road and Del Lago Road in Palm Springs, California on October 8, 2016.
(Photo: Omar Ornelas/The Desert Sun)

Witnesses said they heard between 10 and 20 gunshots from what sounded like machine guns. One witness described hearing several gunshots and then sustained gunfire that rang out for minutes. Soon after, more police arrived.

Gerardo Barrera was working nearby in the neighborhood when he heard the gunfire. "I saw a person on the ground,” he said. “Someone kept pumping her chest but she wasn't moving."

"It was a simple family disturbance and he elected to open fire on a few of the guardians of our city," Reyes later said.

"They were out there every day with boots on the ground for our community," Reyes added. "They gave it all for you."

Another officer was wounded but was alert and well, Reyes said.

"It’s usually a really, really quiet neighborhood," said Luis Velasquez, a neighbor who heard the gunfire. "You always hear of these things going on in Riverside and L.A., New York, things like that. But you never think that it would happen here, your own neighborhood."

A robot leads two vehicles away from the scene of an officer involved shooting that left two Palm Springs Police dead, October 8,2016.
(Photo: Jay Calderon)

A standoff ensues

By 2 p.m., dozens of officers gathered outside a house on the 2700 block of Cypress Road where it appeared, at least for a time, that the suspect was holed up. Officers in tactical gear took defensive positions behind a patrol car and a concrete wall, pointing rifles in the direction of the house. A helicopter circled over the neighborhood.

More than a dozen patrol cars, three fire engines and a SWAT truck were parked on the street as the events unfolded. The area was cordoned off with yellow tape and neighbors were led away from the scene.

With police surrounding the area, neighbor Juan Garciano said he saw Felixs father leave the scene with the police, apparently cooperating with them.

After night fell, officers pointed a spotlight at the front door of the house where the suspect appeared to be hiding. Using a loudspeaker, officers commanded in Spanish and then English: "Salga con las manos arriba!" – “Come out with your hands up!”

The apparent standoff lasted into the early hours of Sunday morning, as officers continued to yell for the suspect to show himself. They set off at least two flash-bangs, but there was no gunfire. Police sprayed the area with what appeared to be tear gas shortly after midnight.

The police were using a robot to investigate the scene. The robot open the front door of the house, dragged it away, went inside and then came out the back entrance, one witness said. No police officers went inside.

Peace officers point to a home on Cypress Road after gunshots where fired wounding at least one. Palm Springs, California on October 8, 2016.
(Photo: Omar Ornelas/The Desert Sun)

Fatal officer shootings up this year, data shows

The shooting came four days after a Los Angeles County sheriff's sergeant was shot and killed in Lancaster while responding to a burglary report, and three months after a gunman killed five officers in Dallas, followed days later by another shooting in Baton Rouge, where three officers were killed.

Nationwide, the number of police shot and killed so far this year is up more than 40 percent from the same time last year, according to data from the National Law Enforcement Officers Memorial Fund. In addition to the deaths on Saturday, the organization says there have been 43 firearms-related deaths of law enforcement officers in 2016, up from 30 officers slain at this time last year.

Palm Springs Mayor Rob Moon, while walking outof the emergency room where the officers were taken, said, "It's probably the worst day of my life."

Palm Springs Police Chief Bryan Reyes responds to questions at a press conference after three officers were involved in a shooting on Saturday, October 8, 2016.
(Photo: Zoe Meyers/The Desert Sun)

Only two other officers have died in the line of duty in the history of the Palm Springs Police Department – one who was shot and killed during an armed robbery in 1961, and one who was killed in a traffic accident during an on-duty incident in 1962.

The deaths were the first homicides in Palm Springs this year. Reyes said the Riverside County Sheriff's central homicide division is leading the investigation.

“My employees are broken. If there’s ever a time to pray for Palm Springs PD, it’s now," Reyes said, standing beside framed photos of the slain officers. "We will get through this.”

“We understand we don’t have all the answers. We heavily rely on the cooperation of our community," Reyes added. "If there was ever a time I needed the cooperation of the community, it was now.”

He urged people not to live-stream the movements of police officers while the suspect was at large. “Understand we are looking for a cop murderer.”

Signs of solidarity

Desert Regional Medical Center, where the three police officers were taken after the shooting, closed its doors to visitors on Saturday.

Relatives of the officers waited outside the emergency department along with uniformed police officers and Riverside County Sheriff's Department staff. Two women broke down wailing, one receiving a hug from a police officer. Then the women were led inside.

Police led a procession on Saturday night escorting the bodies of the slain officers to the Coroner's Office in Indio.

More than 200 people gathered outside the hospital ambulance bay and watched the two flag-draped coffins as they were placed in white hearses. As the hearses pulled away, more than 20 police cars followed with lights flashing. Onlookers waved flags as the procession passed.

Outside the police station, Al Contreras placed two tall blue candles beside a statue on a concrete pedestal, where other people had laid flowers. Contreras had known Vega for three decades, ever since the veteran officer started working in Palm Springs.

In May 2012, Vega and officer John Mejia were honored for saving a 2-month-old girl's life with CPR. In 2013, Vega was named Patrol Operations Officer of the Year by the Palm Desert Area Chamber of Commerce Peace Officer and Public Safety Awards.

City Manager David Ready said he knew Vega well.

"He was a guy who could have retired a long time ago but didn't," Ready said. "He loved being a police officer. Whenever a call went out for overtime shifts, he was always ready to volunteer."

Zerebny was married to a Riverside County Sheriff’s deputy. Reyes described her as a "wonderful, young, dedicated" officer. She had recently returned from maternity leave.

Sheila McCall, of Palm Springs, visited the memorial outside the police department with her 10-year-old daughter.

“I couldn’t imagine having a newborn, going back to work, and this baby’s going to never know her mom because she went to protect other people," McCall said. "And because of that, this daughter gets to grow up without a mother.”