DOWNEY (AP) — A Downey police officer was shot to death in his own car as he was getting off work in what investigators said Thursday was a botched robbery attempt by two young men and a teenager who were arrested within hours.

Downey police Officer Ricardo “Ricky” Galvez, 29, was in plainclothes in the driver’s seat of his car at the end of his shift when two men ran up and opened fire late Wednesday, Los Angeles County sheriff’s Lt. John Corina said.

The five-year department veteran, also a Marine, died in the car.

Corina said the attackers — two men in their 20s and a 17-year-old — were out looking for someone to rob when they spotted Galvez sitting in his car after finishing work. Galvez was shot seconds later.

“They were attempting to rob Officer Galvez not realizing he was a police officer,” Corina said. “I don’t even think he saw these guys coming up on him.”

Another officer heard the gunshots and pursued the attackers as they fled into the neighboring city of Montebello. Investigators said they arrested the getaway driver and other people were detained after SWAT officers swept surrounding neighborhoods.

Police also said they had recovered a gun they suspect was used to kill Galvez.

A young woman who identified herself as the sister of one of the suspects cried and yelled outside a news conference announcing the arrests that her brother didn’t do it.

Detectives knew quickly that Galvez had been shot in a deliberate, targeted attack.

“It appeared to be an ambush style. It happened very quickly,” Corina said after viewing surveillance video of the shooting.

Corina said he wasn’t immediately able to tell if words were exchanged before Galvez was shot.

Downey poice Chief Carl Charles praised Galvez’s professionalism and said the officer had an infectious smile and a great attitude.

“Words cannot express the love we have for Ricky,” he said.

Galvez was a Marine veteran from the Downey area. He was single and lived close to his siblings and other family members, Charles said at a news conference.

Downey police Lt. Mark McDaniel said Galvez “loved serving the city and he loved serving his country.”

“If you could mold a police officer, you would mold that police officer after Ricky Galvez,” McDaniel said. “We have a lot of police officers here who are hurting. We’ll never get over it and we’ll always remember Ricky.”

Dozens of officers wiped away tears and saluted as police carried Galvez’s American flag-draped body from the crime scene to a coroner’s van.

California Gov. Jerry Brown said flags will be flown at half-staff at the Capitol in Sacramento in honor of Galvez.

(© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)