Democrats tried to pass such a law in December.

In December, the Denying Firearms and Explosives to Dangerous Terrorists Act of 2015 amendment was blocked by Republicans (and one Democrat) in the Senate.

60 votes needed to pass 45 YES NO 54 44 Democrats, 1 Republican 53 Republicans, 1 Democrat 60 votes needed to pass 45 54 YES NO 44 Democrats, 1 Republican 53 Republicans, 1 Democrat

The legislation would have given the attorney general authority to deny the sale of a firearm “to a known or suspected terrorist if the prospective recipient may use the firearm or explosive in connection with terrorism,” according to a news release by Senator Dianne Feinstein, the Democrat from California who offered the amendment.

The government currently uses a central watchlist administered by the F.B.I. to track known terrorists and terrorism suspects.

Another December proposal offered by Senator John Cornyn, Republican of Texas, which would have delayed gun purchases by people on the watchlist and given the government 72 hours to investigate them, won more votes than the Democratic version, but also failed. Mr. Cornyn’s proposal is also backed by the National Rifle Association.

There is debate over whether this particular law would have prevented Omar Mateen, the Orlando gunman, from buying his guns.

Mr. Mateen was on a federal terrorist watchlist while being investigated by the F.B.I. in 2013 and 2014, but he was removed after the investigation ended, according to the F.B.I. director, James B. Comey.

If the 2015 legislation had passed and the F.B.I. relied entirely on the watchlist, he would not have been blocked from buying guns from a licensed dealer this month.

But the legislation does not specifically require that someone be named on a particular watchlist to be considered a known terrorist or a suspect, so it is possible that Mr. Mateen could have been flagged under other procedures implemented by the attorney general.

The Justice Department is considering procedures that would alert investigators if someone who had been on a terrorist watchlist tried to buy a gun, according to Sally Q. Yates, the deputy attorney general.

Currently, most people on the watchlist who attempt to buy guns are approved.

The consolidated federal terrorist watchlist had 800,000 people (mostly non-Americans) on it as of September 2014, including 64,000 on a subset referred to as the “no-fly” list, which bars air travel to, from or within the United States.

While inclusion on the list does not disqualify people from purchasing weapons, prospective gun buyers are screened against the terrorist watchlist, and matches are forwarded to F.B.I. agents, who can use the information to help with investigations. Last year, 244 background checks involved people on the list.

According to a study by the Government Accountability Office using data collected by the F.B.I., the vast majority of those on the watchlist who attempted to buy a gun from 2004 to 2015 were allowed to proceed, because they were not stopped by a disqualifying factor like a history of criminal or mental health problems.

Number of F.B.I. background checks for gun purchases involving people on the terrorist watchlist 300 Denied 250 200 150 100 50 Allowed to proceed ’04 ’05 ’06 ’07 ’08 ’09 ’10 ’11 ’12 ’13 ’14 ’15 Beginning in Feb. Statistics were incomplete Number of F.B.I. background checks for gun purchases involving people on the terrorist watchlist 300 Denied 250 200 150 100 50 Allowed to proceed ’04 ’05 ’06 ’07 ’08 ’09 ’10 ’11 ’12 ’13 ’14 ’15 Beginning in Feb. Statistics were incomplete

The F.B.I. has been criticized in the past for being too slow to purge people from the watchlist, and opponents of the legislation cite the fact that those on it have no opportunity to contest their inclusion in court.

Some security experts have also warned against blocking those on the list from purchasing guns because suspects would be alerted that they are under scrutiny. Other proposals include only barring those on the “no-fly” list, who already are aware of their status.

Even if a law closing the terror gap were passed, known terrorists or suspects could still buy guns from a private seller in most states.

Even if the Orlando gunman had been denied the purchase of guns from a licensed dealer because of his connections to terrorism, he could have still obtained weapons legally from a private seller at a gun show or online, because federal law does not require a background check for private purchases.

While some states have their own laws requiring a background check or a permit (issued after a background check) in private sales, Florida is not one of them.

Background check on private sale Not required ME AK VT NH MA WA MT ND SD MN WI MI NY CT RI NE IA IN PA OR ID WY IL OH NJ KS WV CA NV UT CO MO KY DC MD DE AZ NM OK AR TN VA NC Handgun only HI TX LA AL GA SC MS FL Source: Law Center to Prevent Gun Violence