Stephen Silva, the man who lent the gun used by the convicted Boston Marathon bomber to kill a police officer three days after the 2013 attack, was released from prison Tuesday after a judge sentenced him to time already served for drug and firearms charges.

Standing before U.S District Judge Mark Wolf, Silva was sentenced to the 17 months he already served plus three years supervised release to charges he pleaded guilty to last year, reported to The Guardian.

He testified in March to allowing Dzhokhar Tsarnaev to borrow a Ruger 9mm two months prior to the Boston Marathon bombing. At the time, he said he had no knowledge Tsarnaev's plan to bomb the marathon or that the gun in question would be used to kill an officer. Silva said Tsarnaev told him he wanted to use it rob college students in Rhode Island.

Silva was arrested in July 2014 and was charged with possession of a handgun with an obliterated serial number and seven counts of heroin trafficking, reported Sport Act. He later pleaded guilty in December.

Prosecutors sought leniency and asked for an 18-month sentence, citing Silva's cooperation with the investigation, reported the Associated Press. They noted his testimony was critical in convicting Tsarnaev, whose lawyers tried to claim was a secondary player in a plot planned by his brother.

Silva is the last of five people in connection to the Boston Marathon bombing to face criminal charges. Three of his college friends and a cab driver who had been friends with the brothers were all sentenced in June to between three and six years in prison for lying to investigators.

Tsarnaev was sentenced to death via lethal injection in May. His legal team plans to appeal.