Gun owners may not like it when President Obama talks about guns. But gun investors certainly do.

Whenever the president discusses the need for tougher gun control laws, gun stocks go up. A lot.

It happened in the wake of the shootings at Sandy Hook Elementary school in Newtown, Connecticut more than three years ago.

And it happened again on Monday following reports that Obama would unveil executive actions on Tuesday that call for expanded background checks among other things.

On what turned out to be an ugly day for the overall market, shares of Smith & Wesson (SWHC) rose 6%. Sturm Ruger (RGR) popped 3%.

Ammunition makers Olin (OLN) (which owns Winchester) and Vista Outdoor (VSTO) rallied too.

Related: Obama's evolution on gun control

And shares of sporting goods retailer Cabela's (CAB), which generates nearly half of its sales from hunting equipment, held up relatively well amidst the broader market turmoil. The stock finished the day slightly higher.

Most of these gun stocks gained again Tuesday as Obama formally unveiled his new gun control plans.

Smith & Wesson soared another 11% in midday trading while Sturm Ruger was up 7%.

The main reason for the latest gun run? Smith & Wesson raised its sales and earnings outlook for its latest quarter and entire fiscal year, citing "strong growth" in FBI background checks for guns in December.

Strong is actually an understatement. It was a record month for background checks. There were more than 3.3 million. The previous all-time high was 2.78 million in December 2012 -- the month of the Newtown massacre.

As a result, Smith & Wesson's sales for the quarter that ended in December may now be up as much as 38% from a year ago, compared to previous estimates for growth of 18%.

The increased demand for guns should not be a huge surprise.

Related: Record year for background checks in 2015

The terrorist attacks in San Bernardino, California last month -- which capped another year of mass shootings in America -- brought the topic of gun control back to the political front burner.

"The threat of gun control legislation again appears to be driving near-term retail sales acceleration, as consumers rush to dealers to purchase firearms they believe may one day become unavailable," said Wunderlich Securities analyst Rommel Dionisio.

Smith & Wesson and Sturm Ruger benefited from this demand throughout 2015. Sturm Ruger's stock soared more than 75% last year while Smith & Wesson's stock was up more than 132%.

Several investors sarcastically thanked Obama on Twitter for helping to boost sales and profits for the gun makers.

$SWHC guides Q3 eps higher on record gun sales. President Obama deserves a big THANK YOU. — James DePorre (@RevShark) January 4, 2016

3.3 million guns sold in America in December alone That's 74 guns sold each minute 24 hours a day! Please Pres Obama continue $SWHC stimulus — Comfortably Smug (@ComfortablySmug) January 4, 2016

It's possible that gun stocks could continue to move higher for the rest of the week as Obama plans to take his case for gun control directly to the American people with a town hall meeting that will be televised on Thursday night on CNN.

There is also a big industry trade show in Las Vegas later this month. Chris Kreuger, an analyst with Lake Capital Markets, said new product announcements could further excite investors in gun stocks.

Kreuger added that gun control talk isn't the only thing driving the stocks higher. Every time there is another mass shooting, some consumers will rush to buy more guns for their own personal protection -- particularly handguns for concealed carry.

Related: You may own gun stocks and not know it

He said the terrorist attacks in Paris last November were probably another reason why gun sales spiked at the end of last year.

But these stocks are incredibly risky given how closely they are tied to political rhetoric.

Shares of Smith & Wesson and Sturm Ruger tanked in 2014 after surging a year earlier. Gun sales were down as Obama focused less on gun control than he had in the immediate aftermath of Sandy Hook.

And in case you forgot, this is a landmark election year. There will be a new inhabitant of the White House come January 2017 -- as well as a new makeup in Congress.

It's impossible to predict right now whether or not the future president will be more gun-friendly or if he or she will continue to press for stricter gun laws like Obama.

Gun sales may be surging now, but demand could wane if gun control eventually fades from the headlines. Ironically, a Republican in the Oval Office might make gun owners happy ... but it could mean an end to the great gun stock rally.

-- CNNMoney's Aaron Smith contributed to this report