The weapons used in this week's massacre in San Bernardino, California, were purchased legally, raising questions about how preventable gun violence is under current U.S. firearm laws.

Eighty-two percent of weapons involved in mass shootings over the last three decades have been bought legally, according to a database compiled by Mother Jones magazine that defines a mass shooting as taking the lives of at least four people in a public place. Using that criteria, Mother Jones found 73 mass shootings since 1982.

Authorities say Syed Rizwan Farook, 28, and his wife, Tashfeen Malik, 27 — the shooters who killed 14 people and injured 21 others this week in San Bernardino — had two legally purchased .223 caliber assault-style rifles and two 9 mm semi-automatic handguns. Police want to speak to a friend of Farook who purchased the two semi-automatic rifles used in the massacre, authorities told NBC News Friday.

For gun control advocates, the shooting, which officials announced Friday is being investigated as an act of terrorism, resurfaced long-time concerns.

Related: From Housewife to Killer: The Mystery of San Bernardino Shooter Tashfeen Malik

"The way our laws are structured unfortunately often times allow people to legally buy guns who shouldn't," said Mike McLively, a staff attorney at the Law Center to Prevent Gun Violence based in San Francisco.

Such was the case in other horrific mass shootings, including Virginia Tech in 2007 and the Charleston, South Carolina, church shooting in June: in both instances the records of the gunmen likely would have raised red flags had they been fully examined through the federal background check system.

"The way our laws are structured unfortunately often times allow people to legally buy guns who shouldn't."

A large part of the problem: When an individual goes to buy a firearm, they are subject to investigation under the National Instant Criminal Background Check System (NICS). A 72-hour hold is put on the sale.

Related: New Yorker Cover Satirizes America's Obsession With Guns After Mass Shootings

But because federal law operates under the idea of "default proceed," the sale can legally go through after 72 hours — even if a background check hasn't been completed. About nine percent of background checks require further investigation, according to the Law Center to Prevent Gun Violence.

Officials have not said whether there was anything in the San Bernardino shooters' backgrounds that would have popped up in a background check when they bought their weapons, and little is known about the friend who purchased the assault rifles that they used.

Alan Lizotte, a professor of criminal justice at the State University of New York at Albany, said secondary firearm transfers — private sales of weapons between individuals that don't involve a gun dealer or manufacturer — are difficult to track.

Related: Obama Describes U.S. Gun Law Loophole as 'Insane'

"By and large, those secondary transfers aren't regulated at all," he said.

And even when they are, states don't always get the information they need. In New York, for example, the SAFE (Secure Ammunition and Firearms Enforcement) Act of 2013 requires a universal background check, meaning anyone who owns an assault rifle must register it with their county sheriff, whether it's from a private sale or a gun dealer.

"But a lot of the sheriffs have refused to do that, because they're elected officials, and there's a lot of rural counties in New York, and they want to be re-elected," Lizotte said.

"Even if we were to stop all mass shootings tomorrow, we would still have an enormous problem with gun violence."

The Law Center to Prevent Gun Violence is pushing for universal background checks nationwide, not just to prevent mass shootings, which make up a relatively small percentage of all gun violence, but to stop the deaths that are happening from guns every day.

"Even if we were to stop all mass shootings tomorrow, we would still have an enormous problem with gun violence," McLively said.

One measure the Law Center to Prevent Gun Violence is hopeful might help: Starting Jan. 1, 2016, a law passed last year in California will enable concerned family members or law enforcement to petition a court to have someone temporarily disarmed.

The Gun Violence Protective Order will have them "disarmed lawfully and temporarily based on objective warning signs and threat," McLively said. If a court agrees the weapon owner poses an immediate threat to themselves or others, their firearm will be taken away.

"In a lot of these situations, we find out after the fact that the shooter had a troubled history, or had problems in their place of employment that were pretty acute," he added. "In most places, there aren't tools to have people temporarily disarmed that might pose a risk."