Lockheed Martin (LMT 0.59%), the world's largest defense contractor, has been on an impressive run over the last five years, as it has capitalized on an uptick in Pentagon spending. Its shares are up more than 130% since early 2015, more than doubling the S&P 500's 63% gain.

Defense is traditionally a cyclical business, and with election-year budget and deficit talk on the rise there have been some concerns that defense stocks have run about as far as they can. But Lockheed Martin in its year-end earnings discussion made a strong case the momentum can continue through 2020 and beyond, and gave no reason to change my view it is among the best defense stocks to buy right now.

LMT Chart

LMT vs. S&P 500 data by YCharts.

Here's a look at how 2019 ended for Lockheed Martin, and what to expect in the years to come.

Growth all over the portfolio

Lockheed Martin generated fourth-quarter earnings of $5.29 per share, beating the consensus estimate by $0.27, on strong sales growth throughout the portfolio. Revenue growth was driven by increased F-35 sales volume, coupled with continued interest in precision weapons, missile defense, and hypersonics. The company's mission systems, Lockheed's intelligence work, fueled the boost in profits.

LMT Business Segment

Q4 Revenue

Year-Over-Year Change

Aeronautics

$6.38 billion

8.5%

Missiles and fire control

$2.77 billion

14.1%

Rotary and mission systems

$3.89 billion

7.6%

Space

$2.84 billion

14%

Data source: Lockheed Martin.

For the year, Lockheed Martin generated nearly $60 billion in revenue, and the company said it expects net sales of $62.75 billion to $64.25 billion in 2020. Lockheed Martin ended the year with a book-to-bill -- a ratio of orders received to amount billed -- of 1.42, and a backlog of $144 billion, up 10% from year-end 2018.

Lockheed Martin is winning because its businesses cater to some of the Pentagon's top priorities as the military shifts its focus away from battling militias in the Middle East and toward the threat of great-power conflict with Russia or China. The company's F-35, a potential trillion-dollar program for Lockheed and its subcontractors, is the Air Force's go-to fighter, and its work on hypersonics, missiles capable of traveling five times the speed of sound, are thought to be well ahead of those of other contractors.

If there was any disappointment in the results, it was that Lockheed's full-year 2020 earnings guidance of $23.65 to $23.95 per share slightly lagged what analysts had expected. The culprit appears to be tax rate, with Lockheed Martin forecasting a 17% rate compared to analysts' 15.5%. But Lockheed Martin's 10.8% segment margin estimate, compared to 11% in 2019, appears conservative.

A stockpile of cash

Lockheed Martin generated $847 million in free cash flow during the fourth quarter, beating expectations, and the company generated more than $7.3 billion in cash from operations during the year despite making a $1 billion voluntary pension contribution during the year to prefund its 2020 payment and part of its 2021 payment.

The company expects at least $7.6 billion in cash from operations in 2020, and is assuming both $1 billion in share repurchases and a dividend hike during the year. There is also about $1.25 billion in debt that is scheduled to mature, but Lockheed Martin estimates it will have excess cash and a relatively unlevered balance sheet at its disposal during the year.

An F-35 in flight.

Lockheed Martin's aeronautics division still has room to grow as the F-35 nears full-rate production. Image source: Lockheed Martin.

We've seen a fair amount of defense industry consolidation in recent quarters, and Lockheed Martin definitely has the firepower to do a deal. But management seemed lukewarm to the idea on a post-earnings call with investors, with CEO Marillyn A. Hewson saying she is "happy" with the current portfolio.

"We don't really see any gaps right now," Hewson said.

If there isn't a deal, expect more cash to be returned to shareholders. Chief Financial Officer Kenneth Possenriede noted on the call that in recent years Lockheed Martin has "overachieved" in terms of share repurchases, and is very mindful of its dividend.

If you look at the composition of who owns our stock, it's almost 50% are yield investors. So we will certainly pay attention to our yield. Even with the high appreciation of our stock, we still have a very strong dividend yield relative to our share price. But I think the net is, we're not going to let cash -- we've demonstrated this over the last couple years. We're not going to let cash sit on our balance sheet, we will use. We will use it. 

It's not too late to jump in

One benefit of investing in defense stocks is the government is a pretty transparent customer that telegraphs its purchase intentions well in advance. Lockheed Martin has had a great run of growth over the past few years, but the company's massive order book suggests steady gains not only in 2020 but into 2021 and beyond as well.

Lockheed Martin is also among the favorites for considerable new business, including a number of new helicopter competitions and continued development of hypersonic weapons and defense systems. And even if the stock doesn't double again over the next five years, which seems unlikely, as Possenriede notes, there is a steady and growing dividend to help boost returns. Lockheed Martin's current dividend yield is 2.06%, second only to General Dynamics among defense primes.

An election year brings added risk because of the potential for new priorities and policies. Still, the world is not getting any safer, and Lockheed Martin's portfolio is well-positioned to weather any Pentagon spending slowdown. Even after the gains, it is not too late to add Lockheed Martin shares to your portfolio.