Enrique Marquez Jr., 28, supplied the rifles used by his friend Syed Rizwan Farook and Farook's wife, Tashfeen Malik, to open fire on a meeting and holiday gathering of San Bernardino County employees who worked with Farook.
After killing 14 people and wounding 22 others on Dec. 2, 2015, the couple died in a gun battle with authorities.
RELATED: San Bernardino marks 4th anniversary of terror attack
The sentencing in federal court in Riverside came after families of the victims pleaded with a judge to give Marquez a lengthy sentence. Prosecutors had asked for a 25-year sentence and Marquez's attorney had suggested five years.
Marquez has a high IQ and the mental capacity to understand the likelihood of an attack occurring once he bought the weapons, prosecutor Melanie Sartoris said.
"He knew all along that this would happen," but he did nothing, Sartoris said.
Defense attorney John Aquilina argued in court that his client had no knowledge of what was going to happen.
"Mr. Marquez's sentence should not be reflective of what happened in San Bernardino," he said.
Prosecutors contend Marquez must be held responsible for his actions, which include giving semiautomatic weapons and explosives to a person he knew was inspired by violent extremists and plotting with him to kill large numbers of people.
"And the undeniable truth remains: If defendant had not illegally purchased two assault weapons for a terrorist, that terrorist and his wife would not have used those firearms to murder 14 people and wound 22 survivors," prosecutors wrote in a court filing.
The government contends that several years before the massacre, Marquez and Farook had plotted two terrorist attacks on Riverside City College and a local highway, State Route 91.
But Marquez abandoned the idea and distanced himself from Farook in 2012 after three other Southern California men were arrested on suspicion of planning to go to Afghanistan to kill U.S. troops. Eventually, the three and a fourth man were sentenced to federal prison for conspiracy.
Marquez's defense attorney said his client had been manipulated by Farook since he was 13, when they met as neighbors. Aquilina said Marquez was desperate to socialize with others and needed to escape verbal and physical abuse at home.
Marquez had stopped speaking to Farook years before the attack, Aquilina said.
Marquez was arrested soon after the shooting and described to the FBI his research into terror attacks, purchase of explosives and the plans he made with Farook, the government said.
Marquez pleaded guilty in 2017 to conspiring with Farook to provide material support to terrorists and making false statements regarding the rifles he had purchased in his name using Farook's money.
He later tried to withdraw his plea to one of the counts, but the request was denied by the court.
Note: The video in the player above is from a previous story.