RIVERSIDE, Calif. — A law-enforcement officer who resigned last year has been charged with murder in connection with the killing of an unarmed man nearly four years ago, the first time in more than a decade that a Southern California police officer has been prosecuted for an on-the-job shooting.

Oscar Rodriguez, a former Riverside County sheriff's deputy, initially was cleared of wrongdoing in the shooting of Luis Morin, but the county District Attorney's Office later re-opened the investigation after Rodriguez was accused of having an affair with Morin’s girlfriend.

After about a year and a half, investigators presented the case to a grand jury, which voted to indict Rodriguez for murder earlier this month. Rodriguez was arrested Friday morning and is due in court Friday afternoon.

If he is convicted, he faces life in prison. Morin's girlfriend, Diana Perez, also was indicted as an accessory to murder and faces up to three years in prison.

► Tuesday:First U.S. police officer convicted of trying to aid Islamic State

► Dec. 2:Police chief investigating faculty love triangle asked out witness. 3 times.

► Nov. 16:Men who say crooked Chicago cop framed them get mass exoneration

The shooting occurred Jan 27, 2014, as Morin, a 39-year-old father of four, left a family birthday dinner and returned to his mother's house in Coachella, Calif., about 125 miles east of Los Angeles. Rodriguez, who was hiding in the bushes outside the home, surprised Morin and knocked him down.

Rodriguez is then accused of pinning Morin to the ground and shooting him at point-blank range in front of his mother and other relatives, according to the victim's family.

At a press conference in Riverside, District Attorney Mike Hestrin admitted that investigators “didn’t have all the information” and “didn’t ask the right questions” during the initial investigation but insisted Riverside County law enforcement did not participate in a cover-up.

► Sept. 29:Ex-Texas officer ordered to pay $6.3M for death of Iowa man in custody

► Sept. 25:Former Memphis cop arrested outside White House on weapons charges

“This was an isolated case," Hestrin said. "These were the actions of a rogue deputy.”

The shooting prompted a routine criminal investigation from the Riverside County Sheriff’s Department, which analyzes every incident in which a deputy fires a weapon at a suspect. During that investigation, Rodriguez told investigators he was at the house attempting to arrest Morin for two outstanding warrants and Morin tried to take his gun during a struggle.

Rodriguez claimed he shot Morin in self-defense.

That investigation was then forwarded to the District Attorney's Office, where prosecutors initially believed Rodriguez's story, deemed the shooting justified and cleared the deputy of all wrongdoing.

An affair exposed

The case took an alarming turn in September 2015 when a lawsuit filed by Morin’s family exposed what the county referred to as a “new theory of premeditated murder.” While questioning Rodriguez for the lawsuit, a family lawyer revealed a supposed affair between the deputy and Perez, Morin's girlfriend.

Perez is the mother of two of Morin's children, according to federal court records.

► June 17:Jason Stockley verdict shows how rare police officer convictions are

► March 1:7 Baltimore officers arrested, accused of robbing victims

She does not appear specifically to have confirmed the existence of the affair in public court records; However, Brett Greenberg, a lawyer representing her children, referred to the affair while questioning Rodriguez.

“Isn’t it true that you wanted Luis Morin dead and out of the way so that you could continue a relationship with Diana Perez?” Greenfield asked during a deposition.

“I’m exercising my Fifth Amendment right not to testify,” Rodriguez responded, according to a deposition transcript.

Marking an unusual move in police-shooting lawsuits, Rodriguez also pleaded the Fifth dozens of times during the deposition — even refusing to spell his own name — according to excerpts filed in federal court.

But even without answers, the questions were pivotal, exposing a new theory for the motive behind the shooting. During the deposition, Greenberg asked if Rodriguez used his position as a deputy to “lure” Morin’s girlfriend into a sexual relationship.

Rodriguez refused to answer.

Then Greenberg asked if Morin later found out about the secret relationship and the girlfriend ended the affair. Rodriguez again refused to answer.

Did Rodriguez threaten Morin? Rodriguez refused to answer.

► December 2016:FBI searches 2nd property of retired N.Y. cop after bodies found

► December 2016:Ex-officer charged with homicide in death of Wisconsin man

Did he send text messages to the girlfriend both before and after the shooting? Again, no answer.

“And isn’t it true that it bothered you that they were going to have a future together that didn’t involve you?” Greenberg asked.

“I’m exercising my Fifth Amendment right not to testify,” Rodriguez said.

After this questioning, Riverside County attorneys stopped representing Rodriguez, saying that a “conflict-of-interest” had arisen between the county and the deputy. County attorneys then quickly settled the lawsuit, paying Morin’s family $7 million — more than twice as much as other recent shooting lawsuits.

Of more than $37 million that Riverside County paid in excessive force claims in the past decade, this was the largest.

Some of this money likely ended up going to Perez, who now has been charged as an accessory to Morin's murder. About $1.6 million of the settlement money was awarded to two of Morin's children for whom Perez was listed as guardian.

This line of question also prompted the the Riverside County District Attorney's Office to re-open the criminal investigation into Rodriguez, now doubting the prior decision that the shooting was justified. The sheriff’s department also put Rodriguez on paid leave.

He resigned from the department in March 2016.

David Kenner, another lawyer for the Morin family, said Friday that he always felt the Rodriguez shooting was a criminally prosecutable case, but he wasn’t confident charges ever would be filed.

“We always believed it should, but as you said, they don’t often do that,” Kenner said.

This almost never happens

The case against Oscar Rodriguez has taken an unusual path to prosecution, but the road ahead is even less traveled.

Criminal prosecutions against police officers are rare nationwide, and even rarer still in Southern California despite widespread concern about cops' excessive force. In the few cases that are prosecuted, the pivotal evidence is often video footage.

► October 2016:Wisconsin officer in fatal shooting charged with sexual assault

► May 2016:'Shield' actor convicted of murder in killing of wife

This case has none.

Rodriguez is only the second Southern California police officer to be prosecuted for excessive force in a police shooting since 2004, according to a 2016 Los Angeles Timesinvestigation. During that time, police in six counties — Imperial, Los Angeles, Orange, Riverside, San Bernardino and San Diego — have shot more than 2,000 people, averaging one every two days, the Times investigation found.

“You would think, just based on the population alone, we would have more of these cases,” said Philip Stinson, a criminal justice professor at Bowling Green State University in Ohio who studies police prosecutions.

But police shootings are so difficult to prosecute because for decades police officers have owned the narratives of what happened in shootings, leaving prosecutors with little to work with other than what police are willing to tell them, Stinson said. In recent years, police lost their monopoly because of what he called "second narratives."

Often, that second narrative comes from video footage.

In the Rodriguez case, it came from a lawsuit, but the end result is the same.

“What we are seeing in recent times is there is more scrutiny by investigators, and prosecutors and judges — I’m not yet prepared to say juries — but by the courts as a whole,” Stinson said. "They are willing to look for that second narrative, when in the past, they just assumed the police narrative is factually accurate and true in every way.”

► December 2015:Officer who killed unarmed parole violator not charged

► November 2013:Ex-undercover officer outed drug probe to lover, report says

The most recent Southern California officer to be prosecuted for an on-the-job shooting was a San Bernardino County sheriff's deputy, Ivory Webb. He shot an unarmed man after a car chase in Chino in 2006.

Bystander video showed the victim, Elio Carrion, pleading on the ground before he was shot. San Bernardino County prosecutors charged Webb with attempted manslaughter and assault, but a jury ultimately acquitted him.

Follow Brett Kelman on Twitter: @TDSbrettkelman and @BarrettNewkirk