WORCESTER, Mass. — A Massachusetts man accused of threatening to kill the jury during his first murder trial and slapping his lawyer in the face during the second has been sentenced to 18 years in prison as part of a plea deal.

The Telegram & Gazette reports (http://bit.ly/2uM99zH ) that 37-year-old Janleer Povez of Worcester was awaiting a third trial in the 2008 death of a Westborough man before Thursday’s sentencing. His 2010 conviction was overturned, and a 2015 retrial was cut short when Povez slapped his court-appointed attorney.

Povez pleaded guilty to charges including manslaughter, intimidation, assault and battery.

The mother of the slain man objected to the deal, but prosecutors said the case was challenging, describing it as a drug deal gone wrong.

Povez will receive credit for nine years already served.