A man who tried to smuggle drugs aboard an Amtrak train in Arizona before getting caught in a shootout that led to the deaths of his accomplice and a DEA agent has been sentenced to 10 years in prison.

A federal judge in Tucson sentenced 24-year-old Devonte Okeith Mathis on Thursday, the U.S. Attorney's Office for Arizona said. After completing his prison term, he will serve five years of supervised release.

Mathis pleaded guilty to conspiracy to possess with intent to distribute marijuana and two charges related to using and possessing a firearm in relation to drug trafficking.

In October 2021, a regional task force conducted a routine check for contraband on a train that had stopped in downtown Tucson.

ARIZONA OFFICIALS IDENTIFY BODY FOUND IN REMOTE BONFIRE PIT AS MISSING 18-YEAR-OLD

Arizona Amtrak Shooting Sentencing

A Tucson Police Department SWAT truck is parked near the last two cars of an Amtrak train in downtown Tucson, Ariona, on Oct. 4, 2021, following a shooting. (Mamta Popat/Arizona Daily Star via AP, File)

CLICK HERE TO GET THE FOX NEWS APP

Officers were in the middle of detaining Mathis on the upper level of the double-decker car when 26-year-old Darrion Taylor pulled out a handgun and began firing. DEA Special Agent Michael Garbo was shot and killed. A second agent and a police officer were wounded.

Taylor exchanged several rounds with police and then barricaded himself in a bathroom on the lower level. He was later found dead inside.

At the time, Taylor was facing charges in California and was free on bond.

In his plea agreement, Mathis admitted that he knew Taylor had two handguns and would likely use them.