WORCESTER, Mass. (WPRI) — A man was sentenced to serve 38 to 40 years in prison for shooting and killing another man in Blackstone back in 2015.

William Hodges, 41, pleaded guilty to voluntary manslaughter, intimidation of a witness, and possession of a firearm and ammunition, according to the Worcester County District Attorney’s Office.

Prosecutors said Hodges was responsible for the shooting death of Kevin Gonsalves, 33, of Milford, outside a home on Mendon Street.

According to police, the two men had gone to the home under the guise of robbing somebody and Hodges shot Gonsalves three times after he got out of their vehicle.

Neighbors said they saw Gonsalves draped over the railing before police arrived, adding that no one was living at the home at the time.

“On behalf of the Blackstone Police Department, I would like to extend my thoughts to Kevin Gonsalves’ family and friends, and hope that the resolution of this case will help to bring some closure,” Blackstone Police Chief Gregory Gilmore said in a statement.

The judge sentenced Hodges to 19 to 20 years in prison for the manslaughter charge and 19 to 20 years for the witness intimidation charge, which the DA’s office said will be served consecutively.

He was also sentenced to four to five years for gun possession and two years for ammunition, which will be served concurrently.

“From the moment the call came in until this suspect was in custody, agencies from across the region worked together to bring justice for the victim,” Gilmore continued. “I would like to commend the Blackstone Police Officers who worked tirelessly on this case as well as thank our law enforcement partners who helped us in achieving this outcome, including the Massachusetts State Police, Milford Police Department, Blackstone Valley Counter Drug and Counter Crimes Task Force, and District Attorney Joseph Early and his office.”