The Justice Department had supported the legislation sponsored by Sen. Dianne Feinstein of California.
The largely party-line vote was 47-53. It fell 13 votes short of the 60 necessary to move forward.
The vote came just over a week after the massacre in Orlando, Florida, that killed 49 people. The shooter, Omar Mateen, had been the focus of two terror investigations that were dropped. He described himself as an Islamic soldier in a 911 call during the shootings.