Two Massachusetts men who pleaded guilty in July to planning to sell fentanyl to veterans being treated for substance abuse at a Boston-area Veterans Affairs medical center, have been sentenced to time in prison.

The state's U.S. Attorney’s Office said 30-year-old Deiby Bladimil Casado Ruiz of Lawrence was sentenced Nov. 1 by U.S. District Court Judge Indira Talwani to 24 months in prison, plus three years of supervised release.

On Monday, Talwani sentenced 31-year-old Pedro Antonio Sanchez Bernabel, also of Lawrence, to 14 months in prison and three years of supervised release.

FBI MAKES MASSIVE DRUG BUSTS IN MASSACHUSETTS, SEIZE FENTANYL-LACED, PINK HEART-SHAPED CANDY PILLS

Bedford Veterans Affairs Hospital

Bedford VA Hospital in Bedford, Mass. (Matthew J. Lee/The Boston Globe via Getty Images/File)

Both men pleaded guilty July 21 to single counts of conspiracy to distribute fentanyl and distribution of fentanyl.

Casado Ruiz and Bernabel were accused of attempting to distribute fentanyl to veterans at the VA medical center in Bedford over a three-month period, starting on July 27, 2022.

According to the U.S. Attorney’s office, the two men sold fentanyl to multiple individuals, including one veteran seeking treatment at the center for a substance use disorder.

TWO MEN BUSTED FOR ATTEMPTING TO SELL FENTANYL TO VETS IN BOSTON VA SUBSTANCE ABUSE PROGRAMS

VA building sign in Washington DC

Outside the U.S. Department of Veterans Affairs building in Washington, D.C. (Alastair Pike/AFP via Getty Images/File)

Had an agreement not been reached, both men were facing mandatory minimum sentences of 5 to 40 years for conspiring to distribute 40 grams or more of fentanyl.

At the time of their arrest, Joseph R. Bonavolonta, a special agent in the Federal Bureau of Investigation, said what they were accused of doing was "absolutely appalling."

BORDER PATROL SEIZED ENOUGH FENTANYL TO KILL ENTIRE US POPULATION THIS FISCAL YEAR

Fentanyl pills

Fentanyl pills disguised as Oxycodone. (Craig Kohlruss/The Fresno Bee/Tribune News Service via Getty Images/File)

"We believe they targeted veterans who have valiantly defended our country’s freedoms and are now seeking treatment for their substance abuse disorder, and supplied them with fentanyl, a deadly narcotic 50-100 times stronger than morphine," he said.

Veterans with post-traumatic stress disorder are at increased risk of drug abuse, with the VA estimating that 20% of veterans who suffer from PTSD also abuse drugs or alcohol.

CLICK HERE TO GET THE FOX NEWS APP

Fentanyl has become the leading driver of the opioid crisis in the U.S. and small amounts can lead to overdose deaths.

Fox News Digital's Michael Lee contributed to this report.