If you're seeking a reliable dividend stock with stable cash flows, the defense contractor Lockheed Martin (LMT -0.64%) is one company you might want to consider. The war in Ukraine and rising tensions in the Middle East have sparked a newfound interest in defense stocks, and Lockheed is one of the largest defense contractors in the U.S.

Lockheed Martin's margins have come under question, and the stock has fallen 7% compared to the S&P 500's 19% gain in 2023. Is the stock a buy? Let's find out.

Most of Lockheed Martin's customers are governments

Lockheed Martin is a contractor that designs and develops advanced technology systems in aerospace, defense, and information security, primarily for governments and some commercial customers.

It creates technologies to strengthen national security and is the world's largest defense contractor by total sales. According to Bloomberg Government, the company's $46 billion in contract obligations makes it the largest defense contractor in the U.S., ahead of RTX ($26 billion) and General Dynamics ($22 billion).

The U.S. government is Lockheed's largest customer, accounting for 73% of its net sales, with the Defense Department accounting for 64%, and international customers, including foreign militaries, accounting for 26%.

Government contracts provide stable cash flows

Defense spending is necessary for national security, and demand has increased in recent years amid growing geopolitical conflict. According to the Stockholm International Peace Research Institute, the U.S. is the biggest spender on defense, accounting for 40% of global military expenditures -- $877 billion -- last year.

The Congressional Budget Office projects the U.S. could surpass $1 trillion in defense spending by 2032, although some believe that threshold could be crossed as soon as five years earlier.

Lockheed, the top defense contractor in the world, has seen increased spending by governments across the globe leave it with a strong backlog that currently sits at $156 billion, a stable source of cash flows.

For example, the U.S. Defense Department will buy 2,500 of its F-35 aircraft for $400 billion, and operation and maintenance of those planes could cost another $1.27 trillion over their 66-year life cycle.

A professional sits at desk and reviews charts on multiple computers.

Image source: Getty Images.

Lockheed Martin faces these headwinds in the near term

Recent growth has been relatively modest, with revenue and net income rising by compound annual rates of 4.7% and 6.6%, respectively, over the past five years. Also, its margins have come under pressure due to rising costs.

Lockheed signed many of its fixed-price contracts before inflation worsened, and difficulties obtaining materials and labor have weighed on its costs and profit margins. As supply chain pressures subside, margins should improve.

One other concern among investors is Lockheed's modest guidance. Its 2024 outlook for growth in the low single digits is "disappointing," according to Bank of America analyst Ronald Epstein, but "the largest disappointment" is its free-cash-flow projections through 2026, which it expects to remain flat at around $6 billion annually.

Is it a buy?

The company faces near-term headwinds from margin compression, modest revenue, and free-cash-flow growth. Its valuation reflects some of these concerns, with the stock trading at around 16.5 times earnings and 1.66 times sales, below its five-year averages.

LMT PE Ratio Chart

LMT PE Ratio data by YCharts; P/E = price to earnings, PS = price to sales.

Despite the slower growth, Lockheed has a strong balance sheet and continues to reward shareholders through dividends and stock buybacks. The company has raised its payout for 21 consecutive years, returned $3 billion to shareholders through stock buybacks, and authorized up to $13 billion in future buybacks -- which should continue to reduce share count.

Lockheed Martin has to work through some near-term headwinds, and defense budgets are always subject to political risks. But ongoing geopolitical conflict means that its valuation, strong balance sheet, capital returns to shareholders, and status as a top defense contractor make it a solid stock to buy and hold for the long haul.