A revolver sits on display in the Sturm, Ruger & Co., Inc. booth on the exhibition floor of the 144th National Rifle Association (NRA) Annual Meetings and Exhibits.

Shares of gun manufacturer American Outdoor Brands, the parent company of Smith & Wesson, closed higher on Thursday following the tragic shooting at a high school in Florida.

The company's stock rose 1.2 percent and rose as much as 4.5 percent. Sturm Ruger briefly gained 2.8 percent before closing 0.2 percent lower.

The Broward County Sheriff's Office said 17 people were gunned down Wednesday at Marjory Stoneman Douglas High School in Parkland, Florida. The shooter, identified as 19-year-old former student Nikolas Cruz, was booked on 17 counts of premeditated murder Thursday. He allegedly used an AR-15 assault rifle in the rampage.

Shares of Sturm Ruger and American Outdoor Brands rallied Wednesday afternoon as news of the shooting spread. The stocks closed Wednesday 2.8 percent and 5.6 percent higher, respectively.

Stock prices of gunmakers often rise after mass shootings on the theory that people will stockpile weapons in anticipation of tougher gun-control laws.

History shows that Sturm Ruger and American Outdoor Brands rise 1.6 percent and 2.2 percent, respectively, five days after a mass shooting, a CNBC study using Kensho found. The study looked at their performance following mass shootings dating back five years.

Several U.S. lawmakers called for tougher gun control laws in the wake of the shooting. Sen. Chris Murphy, D-Conn., tweeted Wednesday night: "Don't tell me tomorrow isn't the appropriate time to debate gun violence. If you're a political leader doing nothing about this slaughter, you're an accomplice."

Murphy tweet

Rep. Eliot Engel, D-N.Y., said: "Another terrible school shooting, this time in Florida. At least 18 other school shootings have already happened this year. My heart breaks for those children and their parents. How many more victims until we decide gun violence is a national problem?"

Engel tweet

Rep. Lloyd Doggett, D-Texas, also tweeted: "Another day, another shooting, indeed, multiple shootings today, while Congress sits in the grip of the NRA, incapable of making the slightest gesture toward reasonable gun safety."

Doggett tweet

However, new gun-control laws are unlikely to be passed anytime soon. Both the Senate and the House are controlled by the Republican Party, and many of their members receive contributions from the National Rifle Association, which heavily opposes gun regulation.

President Donald Trump has resisted calls for greater gun control measures after previous mass shootings. He tweeted condolences on Wednesday.

My prayers and condolences to the families of the victims of the terrible Florida shooting. No child, teacher or anyone else should ever feel unsafe in an American school.

Disclosure: NBCUniversal, parent of CNBC, is a minority investor in Kensho.