A former Jersey City firefighter convicted of selling heroin in Massachusetts was sentenced Thursday to five years in federal prison.

Carlos Jimenez, 52, of Englishtown, will also be subject to four years of supervised release after completing his stint in prison, the U.S. Attorney’s Office for the District of Massachusetts said.

Jimenez’s associate, Ivan Cruz-Rivera, 50, of Dorado, Puerto Rico, was sentenced earlier this week to six years in two months in federal prison.

Jimenez was previously convicted of two counts of heroin distribution following a 12-day trial. He and Cruz-Rivera had been targets of the investigation since January 2011 when an informant began working with police and purchasing heroin from Jimenez.

The charges stemmed from an incident in October 2013, when the two met with the cooperating witness and provided a cardboard box containing heroin in exchange for $7,500.

A Massachusetts state trooper followed their car after the drug deal and pulled them over after they committed a traffic violation. A search found a bag that troopers said contained bundles of money totaling $44,000, as well as three cell phones, including one in the bag with the money.

A firefighter in Jersey City for more than 20 years, Jimenez worked for Engine 17 on Kearney Avenue. He was suspended without pay from his $111,300 a year job following his arrest. Jiminez was later fired and his pension was revoked.

Corey W. McDonald of the Jersey Journal contributed to this report. Jeff Goldman may be reached at jeff_goldman@njadvancemedia.com. Follow him on Twitter @JeffSGoldman. Find NJ.com on Facebook.

Have a tip? Tell us. nj.com/tips

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.