A Massachusetts man has been sentenced to six years, eight months in federal prison for trafficking in fentanyl.

Rafael Buli, 24, of Lawrence was sentenced Friday in Portland by U.S. District Judge Jon D. Levy for conspiracy to distribute, and possession with intent to distribute, and aiding and abetting the possession with intent to distribute fentanyl.

He was also sentenced to three years of supervised release.

The sentence will run consecutively to a three-year sentence that Buli is currently serving in Massachusetts for assault and battery with a dangerous weapon.

Buli pleaded guilty to the Maine charges on Feb. 2.

According to court records, Buli, Wender Santos and others conspired to distribute fentanyl in the Lawrence area. Maine drug customers contacted Santos, who told Buli to sell them drugs. On Sept. 1, 2016, federal and state agents stopped a Maine customer after Buli had sold him about 400 grams of fentanyl.

At the time of many of the transactions, Buli was being electronically monitored by the Massachusetts Department of Probation, and the electronic monitoring bracelet he was wearing placed him at the scene of several controlled buys of drugs conducted by federal agents.

Santos pleaded guilty on April 3 to the same charges as Buli and awaits sentencing.