The man, Enrique Marquez Jr., 28, pleaded guilty in 2017 to providing the two assault rifles that were used by his friend, Syed Rizwan Farook, and Mr. Farook’s wife, Tashfeen Malik, in the attack at a holiday party on Dec. 2, 2015, with Mr. Farook’s co-workers at a social services center. Mr. Marquez also pleaded guilty to plotting two unrealized terrorist attacks in California in 2011 and 2012.
In pleading guilty, Mr. Marquez had acknowledged making false statements in connection with his role as a “straw buyer” of the rifles, federal prosecutors said.
Mr. Farook and Ms. Malik were killed in a shootout with the authorities hours after the massacre, which was the worst terrorist attack on American soil since Sept. 11, 2001, federal prosecutors said. Mr. Marquez, of Riverside, Calif., did not participate in the shooting, which also injured more than 20 people.
Law enforcement have called the shooting an Isis-inspired attack and have pointed out that Ms. Malik pledged allegiance to the Islamic State on Facebook on the day of the shooting.
Those attacks were never carried out, but Mr. Marquez had discussed with Mr. Farook using radio-controlled improvised explosive devices for the attacks and bought Christmas tree light bulbs and a container of smokeless powder to use in the devices, federal prosecutors said.
In court on Friday, relatives of the victims asked Judge Jesus G. Bernal of U.S. District Court in Central California to impose a lengthy sentence.
“He’s a terrorist, your honor,” said Gregory Clayborn, whose daughter, Sierra, was killed, The Associated Press reported. “And if you let him out, he’s going to do it again.”
In imposing a 20-year sentence, Judge Bernal denied a request by Mr. Marquez’s lawyer for a five-year sentence, which prosecutors said would essentially have been equal to time served and would have resulted in Mr. Marquez’s swift release from custody.
Federal prosecutors called Mr. Marquez’s request an attempt to “downplay the seriousness of his actions, and skirt that his actions contributed to the mass killing.” He had faced a maximum sentence of 25 years in prison.
“This defendant was an active member of a conspiracy that planned to inflict death and destruction on innocent people,” Tracy Wilkison, a first assistant U.S. attorney, said in a statement on Friday. “Today’s sentence is the direct result of actions that enabled a terrorist and laid the foundation for an attack that took 14 innocent lives, wounded 22 others and shook the entire nation.”
John N. Aquilina, Mr. Marquez’s lawyer, said in a phone interview that his client had spent seven years in a “subservient role” to Mr. Farook. He said Mr. Marquez was 13 when he met Mr. Farook, who was 18 and was his neighbor in Riverside, Calif., in 2005. He said Mr. Marquez essentially left his own family to be with Mr. Farook.
“He was attracted to the Farook family and felt part of the family he didn’t have at home,” Mr. Aquilina said. “That’s pretty much why Marquez was in a subservient role, following Farook wherever he went and doing whatever he did.”
He said Mr. Farook had persuaded Mr. Marquez, who was raised Roman Catholic, to convert to Islam when he was 16.
“It just shows you the domination that Farook had over Marquez,” Mr. Aquilina said. “By all accounts, it was Farook who was the mover and shaker.”
Mr. Marquez eventually cut off contact with Mr. Farook in 2012, after Mr. Farook assaulted him, Mr. Aquilina said.
Soon after the attack in San Bernardino, investigators uncovered evidence that Mr. Marquez in 2011 and 2012 bought the two rifles used in the shooting, federal prosecutors said. Mr. Marquez admitted in his plea agreement that Mr. Farook had paid him for the weapons, federal prosecutors said.
Mr. Marquez was arrested about two weeks after the massacre and has been in custody since his first court appearance, on Dec. 17, 2015.
The investigation into the shooting also led to three people pleading guilty to being part of a sham marriage scheme in which a Russian woman married Mr. Marquez to obtain immigration benefits, federal prosecutors said.
Syed Raheel Farook, 35, the brother of the shooter, Syed Rizwan Farook, as well as Tatiana Farook, 36, who is Syed Raheel Farook’s wife; and Mariya Chernykh, 30, who is Tatiana Farook’s sister, pleaded guilty to immigration fraud charges and admitted that they were part of a conspiracy in which Ms. Chernykh paid Mr. Marquez to enter into a bogus marriage, prosecutors said.
The three defendants are to be sentenced later this year and early next year.
In another case stemming from the investigation, the mother of Syed Rizwan Farook pleaded guilty in March to a charge of intending to impede a federal criminal investigation by shredding a map her son had made in connection with the attack.
The mother, Rafia Sultana Shareef, 67, of Corona, Calif., is scheduled to be sentenced by Judge Bernal on Nov. 16.