A 40-year term, the maximum allowed by law, is the punishment for a 27-year-old Minneapolis man who shot and killed a Mounds View man seeking to buy drugs.

The sentencing Tuesday of Lannon Burdunice in Hennepin County District Court ends his second prosecution in the killing of Joshua B. Hofmann, 31, on July 19, 2016.

Last fall, jurors deadlocked and a mistrial was declared, prompting a retrial this year that saw the jury taking less than three hours to find Burdunice guilty of second-degree murder, while acquitting him of first-degree murder.

Counting time in jail since his arrest, Burdunice will serve roughly the first 25 ½ years of his sentence in prison and the balance on supervised release.

Hofmann’s mother, Juanita, said during sentencing that “when Lannon made a conscious decision to pull out a gun and shoot and kill my son, he killed a part of all of us that day as well.”

The charges stemmed from a night when the victim and his girlfriend drove to 66th and Camden avenues N. in Brooklyn Center to buy marijuana from Burdunice. Hofmann’s friend testified that Hofmann argued with Burdunice over the price of the marijuana. Burdunice, standing outside the car, shot Hofmann twice.

Burdunice’s criminal history in Minnesota includes convictions for second-degree assault, violating a no-contact order and terroristic threats.

According to the criminal complaint, officers responding to a call about shots being fired came up to a car and saw Hofmann behind the wheel, already dead. Two $20 bills were at his feet.

Hofmann’s girlfriend, Kaitlyn Schroeder, said she and Hofmann had arranged to buy marijuana from Burdunice. Instead, Burdunice attempted to rob Hofmann of $40. She directed police to a townhouse, where Burdunice was arrested.