The tendency to lean on political beliefs is one of the most powerful forces in investing and financial media, and one of the most dangerous. There’s a general sense that Republicans are good for business (lower taxes, fewer regulations, an overall permisiveness) and therefore good for the stock market. And there’s a sense that Democrats are bad for business (higher taxes, more regs, a skepticism toward industry’s prerogatives) and therefore bad for the stock market. The lived experienced of the markets over the past 25 years—booming under Clinton and Obama, tanking under Bush—should give the lie to this feeling. But it endures. And it has become particularly powerful under Trump, who regards the stock market as a kind of real-time approval gauge.

But doing so is precarious. And it can be continually confounding at the macro level and at the level of sectors and individual companies. That’s a lesson that investors who held stocks in tobacco companies—in particular the biggest one, Altria (formerly Philip Morris)—learned Friday.

Tobacco companies are in a strange position right now. Smoking is on the decline in the U.S., in part because of government efforts to discourage it via higher taxation, regulation, outright bans, and President Obama’s use of the bully pulpit and the executive pen. Only about 15.1 percent of Americans smoked in 2016, down from about 21 percent in 2005, according to the Centers for Disease Control and Prevention. And yet the profits of tobacco companies, paradoxically, are booming, in part because sales overseas are growing and in part because tobacco companies have the ability to raise prices. (That’s one of the advantages of making a product that is addictive.) Altria’s profit margins on tobacco products are remarkably high. Between 2001 and 2016, as the chart on Page 11 of Altria’s annual report shows, Altria’s stock nearly tripled, while the S&P 500 merely doubled.

Altria’s stock, like many others, continued to soar after Trump’s election—up about 10 percent in the first half of the year. It’s not hard to see why. Aside from benefiting from the general pro-business agenda of Trump—cutting corporate taxes, reducing the capital gains tax, and so on—Altria would seem to have far less to fear from a Trump administration than from an Obama or Clinton administration. While he doesn’t drink or smoke, Trump isn’t a particularly healthy person: He doesn’t work out or exercise or maintain a healthy diet. His administration has backed measures that would cut health care spending by hundreds of billions of dollars, some of which is now spent on smoking cessation. The Trump administration is full of lobbyists and corporate types eager to do the bidding of companies. The likelihood of the first family engaging in aggressive anti-smoking campaigns is laughable. Altria kicked in $500,000 to fund the Trump inauguration.

And the person Trump named to be the head of the Food and Drug Administration, which regulates tobacco, doesn’t have a history of anti-smoking activism. Scott Gottlieb is a physician, biotech investor, and former resident fellow at the American Enterprise Institute who also served in the Bush administration. What’s more, Gottlieb has been strongly in favor of deregulating pharmaceuticals and medical devices, as part of an effort to bring innovations to market more quickly and reduce costs.

And yet Friday morning, with little apparent warning, Gottlieb announced a new comprehensive plan to regulate nicotine. In an aggressive speech that spoke about cigarettes and nicotine in harsh terms, Gottlieb said “we need to envision a world where cigarettes lose their addictive potential through reduced nicotine levels.” For this reason, Gottlieb said, “I’m directing our Center for Tobacco Products to develop a comprehensive nicotine regulatory plan premised on the need to confront and alter cigarette addiction.” With a “balanced regulatory approach,” he noted, “we may be able to reach a day when the most harmful products are no longer capable of addicting our kids.”

This clearly came as a surprise to the companies and to their investors. Stocks reacted violently. In about 30 minutes, Altria’s stock fell 15 percent, sawing nearly $21 billion in market capitalization off the company. By later in the afternoon, the stock had stabilized, though it was still off by about 10 percent, or about $14 billion.

Clearly, investors and the tobacco companies believed that the Trump FDA would take a more hands-off approach to regulating tobacco. After all, we’ve seen sharp pullbacks from regulation of toxic emissions and substances at the Environmental Protection Agency and a general desire to rip up consumer protections. But just because there’s a general air of deregulation, and just because people now in positions of responsibility are hostile to scientific consensus (hello, EPA and Interior), doesn’t mean that all important executive-branch appointees do so.

That’s the mistake tobacco investors made. Gottlieb, after all, is a physician, and a cancer survivor to boot. The science and medicine surrounding tobacco is long since settled, and the consensus is broad. The product has been regulated, without much controversy, for several decades. Everybody involved in health care really hates tobacco, an addictive product that has a host of really bad, expensive, and predictable effects on people’s health. “As a physician who cared for hospitalized cancer patients, and as a cancer survivor myself, I saw first-hand the impact of tobacco,” Gottlieb said in a speech Friday. “And I know all too well that it’s cigarettes that are the primary cause of tobacco-related disease and death. What’s now clear is that FDA is at a unique moment in history, with profound new tools to address this devastating impact.”

Not all of Trump’s appointees will be pro-corporate stooges at all times. And investing as if they are can be remarkably expensive.