BOSTON -- A city man described as a major heroin trafficker who was caught trying to sell two kilograms of fentanyl in a deal set up by federal agents was sentenced to 19 years in prison on Wednesday.

Edgar Belis, 34, pleaded guilty in April to possession with intent to distribute fentanyl and cocaine and being a felon in possession of a firearm and ammunition. U.S. District Court Judge Nathaniel M. Gorton sentenced him 19 years in prison followed by five years supervised release, said Christina DiLorio-Sterling, spokeswoman for U.S. Attorney Andrew Lelling.

law enforcement agents identified Belis, who had been convicted at least four previous heroin-related offenses, as a large-scale heroin trafficker in the Boston area, she said.

During an investigation, law enforcement agents using a cooperating witness set up drug buys with Belis.

"During these calls, Belis stated that he had kilogram quantities of heroin to sell, but suggested that the heroin must contain fentanyl or customers on the street would notice a difference. Belis stated that he would be willing to sell heroin or fentanyl for $40,000 per kilogram," DiLorio-Sterling said in writing.

Law enforcement agents in 2016 set up a deal and then followed Belis from Hopkinton to Boston, where he was seen picking up a backpack. He then went to South Boston to make the promised transaction to sell two kilograms of fentanyl, she said.

Officers arrested Belis at the location and found 2.35 kilograms of fentanyl and 250 grams of cocaine in the backpack. In a subsequent search of his apartment they also found 300 more grams of fentanyl, about 125 grams of cocaine, $57,500 in cash, a Glock .40 caliber pistol and 31 rounds of ammunition, DiLorio-Sterling said.

Lelling; Brian D. Boyle, special agent in charge of the Drug Enforcement Administration, Boston Field Division; Colonel Kerry A. Gilpin, superintendent of the Massachusetts State Police; and Boston Police Commissioner William Gross announced the conviction together.