Stephen Silva, a close friend of the Boston Marathon bombers, has been sentenced to time served plus three years' supervised release for providing the pistol used to kill MIT police officer Sean Collier. A similar case is playing out in California.

A man who loaned a gun to the Boston Marathon bombers, who used it kill a police officer three days after the 2013 attack, has been sentenced to time served.

Stephen Silva was sentenced by US District Judge Mark Wolf to time served plus three years' supervised release after pleading guilty to drug and firearms charges last year.

Mr. Silva testified in March during the trial of Dzhokhar Tsarnaev that he let Mr. Tsarnaev borrow a Ruger 9mm handgun two months before the bombings. He said Tsarnaev told him he wanted it to rob University of Rhode Island students. He also said Tsarnaev “kept coming up with excuses” for why he didn’t return the gun.

The April 13, 2013 bombing killed three people and injured more than 260 others. Tsarnaev was found guilty in April of carrying out the bombing attack along with his older brother who died following a gunfight with police later that night.

This case has echoes of another case currently playing out across the country. Last week, law enforcement filed criminal charges against Enrique Marquez, of Riverside, Calif., who authorities say provided firearms to his neighbor Syed Farook, who, with his wife, Tafsheen Malik, carried out a rampage early this month, killing 14 people at an office Christmas lunch in San Bernardino.

Marquez's illegal gun transfer to the couple also highlights so-called straw purchases, when a gun is bought by someone who intends to give it to someone else. According to a PBS 'Frontline' report, such gun sales are often easy to spot, with both individuals visiting a gun dealer together to make the purchase, and account for a significant percentage of guns used in crimes, versus only 10-15 percent that are stolen.

According to federal authorities, Mr. Marquez and Mr. Farook plotted two mass killings in Southern California in 2011 and 2012, only to abandon the plots and to drift apart by the time Farook and Malik carried out the December 2 attack.

On Monday, a US magistrate judge ruled that Marquez will remain in custody as his criminal case continues.

Assistant US Attorney Christopher Grigg said Marquez’s alleged past scheming with Farook could not be separated from mass shooting though he acknowledged that there was no evidence that Marquez participated in the deadly attack.

“Nonetheless,” he said according to the Los Angeles Times, “the plotting was real, the arming of Mr. Farook happened and the San Bernardino shooting resulted.”

In contrast, Silva was not accused of playing any role in the bombing at the Boston Marathon finish line.