When President Dwight D. Eisenhower spoke of the influence of the military-industrial complex nearly 60 years ago, he was issuing a warning, not giving investment advice. But he could’ve been, because, since then, military spending in the United States has remained as enormous as a giant aircraft carrier.

Today, it amounts to about $700 billion a year — roughly one-sixth of the federal budget — and accounts for much of the annual sales of such stock market stalwarts as General Dynamics, Lockheed Martin, Northrop Grumman and Raytheon.

That combination of federal dollars and corporate heft may represent an opportunity for investors who don’t mind profiting from warfare. A modest bet on a mutual fund or exchange-traded fund that buys military contractors and aerospace companies may help buffer the deep recession brought on by the coronavirus.

Military contractors are, to a large extent, “selling to one major customer — the U.S. government,” said Jonathan W. Siegmann, manager of the Fidelity Select Defense and Aerospace Portfolio. “That customer buys things much differently from anyone else in the world.”