RIVERSIDE, CALIF -- The man who bought two rifles that husband-and-wife assailants used to kill 14 people in a Southern California terror attack nearly five years ago was sentenced Friday to 20 years in prison.

Enrique Marquez Jr. supplied the weapons that Syed Rizwan Farook and Farook's wife, Tashfeen Malik, used on Dec. 2, 2015, to open fire on a meeting and holiday gathering of San Bernardino County employees who worked with Farook. Minutes later, a post on a Facebook page associated with Malik pledged allegiance to the leader of the Islamic State terror group. The couple fled and died later that day in a gunbattle with authorities.

Marquez, 28, showed no emotion during a federal court hearing as relatives of the victims asked the judge to give him a lengthy sentence for providing Farook the guns years before the shooting, which at the time was the deadliest terror attack in the United States since 9-11.

Gregory Clayborn, whose daughter Sierra was killed, said Marquez should be held responsible for the massacre though he wasn't the gunman.

"He's a terrorist, your honour," Clayborn told the judge. "And if you let him out, he's going to do it again."

Prosecutors sought a 25-year sentence for Marquez, arguing that he gave semiautomatic weapons and explosives to Farook though he knew Farook was inspired by violent extremists and had plotted with him years earlier to kill large numbers of people in attacks on a highway and college campus.

At the hearing, federal prosecutor Melanie Sartoris said Marquez has a high IQ and the mental capacity to understand the likelihood of an attack once he had bought the weapons.

"He knew all along that this would happen," but he did nothing, she said.

The defence had asked for a five-year term. Marquez's attorney, John Aquilina, said his client had been manipulated by Farook since he was 13, when they met as neighbours.

Marquez was desperate to socialize with others and needed to escape abuse at home. He had stopped speaking to Farook years before the attack and didn't know it was going to happen, Aquilina said.

"Mr. Marquez's sentence should not be reflective of what happened in San Bernardino," he said.

In determining the sentence, U.S. District Judge Jesus Bernal said he took into account that Marquez had called 911 and co-operated with authorities.

"In a legal sense, I cannot punish Mr. Marquez for your loss," Bernal told the families in his courtroom. "He is not responsible for the murders."

Hilario Venoya Jr., whose son was shot twice and survived, said he wished Marquez received a longer sentence. His son didn't attend the hearing because he is trying to move on.

"He'll never be the same," Venoya said.

Marquez and his family moved next door to Farook's family in 2005. Authorities said that by 2011, Marquez was spending time at Farook's house, watching videos involving what they said was "radical Islamic content."'

Several years before the shooting, authorities said Marquez and Farook plotted terrorist attacks on Riverside City College and a 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.

Farook met Malik, who lived in Pakistan, online. She travelled to the United States to marry Farook in 2014.

To carry out the shooting, the couple left their 6-month-old daughter with Farook's mother, saying they were going to a doctor's appointment. Afterward, police chased the pair through San Bernardino, which is 60 miles (97 kilometres) east of Los Angeles. Soon after they were killed, Marquez called 911 to say the shooter was his neighbour and had used his gun.

The next day, Marquez went to a hospital emergency room and was placed in a psychiatric ward. He was later arrested, and in FBI interviews, described his research into terror attacks, purchase of explosives and the plans he had made with Farook, according to U.S. authorities.

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.