A former Massachusetts police detective has been convicted of first-degree murder in the shooting death nearly five years ago of his wife, which was originally ruled a suicide.

Former Westfield Detective Brian Fanion was sentenced Wednesday in Hampden Superior Court to a mandatory term of life in prison after being found guilty by a jury of killing Amy Fanion, 51, in May 2018.

The prosecutor said Brian Fanion was having an affair and did not want to share his pension with his wife. Authorities said in court that the detective used his work computer to look up the effect of divorce on a pension, and also made internet searches about gunshot residue, which were not related to any investigations he was involved in.

MASSACHUSETTS GOV. MAURA HEALEY REMINDS PHARMACIES THEY MUST STOCK UP ON ABORTION PILLS

"Mr. Fanion’s behavior was calculating and shockingly cruel," Hampden District Attorney Anthony Gulluni said in a statement. "I commend the members of the jury who saw through his defense and held him accountable. This result illustrates that no matter your position or power, justice is blind."

Massachusetts Fox News graphic

A former detective from Massachusetts was convicted of first-degree murder in the killing of his former wife.

The defense argued in court that Amy Fanion took her own life during an argument about the couple's retirement plans.

CLICK HERE TO GET THE FOX NEWS APP

"Your honor, the jury got it wrong," defense attorney Jeffrey Brown said after the verdict.