A grizzled career criminal who claimed “divine intervention” led him to shoot his parole officer – also revealed in court today that he married two women while behind bars for setting a fatal fire in 1979.

Robert Morales, 52, stands trial for shooting his Brooklyn parole officer, Samuel Salters, in the shoulder in 2010.

“Yes, I got married twice! I was locked up and it was sad. But it wasn’t all bad,” Morales said on the stand, adding that he divorced his first wife before marrying the second – who he also divorced.

Morales also testified that he planned to just “whoop Salters’ a–,” that day but decided to shoot him after finding a gun in a trashcan.

“Right there, it’s felt like divine intervention for me. Why else would the gun be right there at that time?” Morales asked.

Morales was on parole for setting a fire that killed an 8-year-old boy. He was sentenced to 25 years to life in 1979 and released in 2002.