Investors had high hopes for Lockheed Martin (NYSE:LMT) heading into the company's third-quarter earnings report, and the aerospace giant delivered results that lived up to those expectations. The company reported earnings per share of $5.14, beating estimates by $0.87, on revenue that, at $14.32 billion, beat expectations by $1.23 billion.

There was a lot to like about the quarter, with all four Lockheed Martin segments delivering top-line growth of between 11% and 20%. The company generated $361 million in cash from operations in the quarter, even after making a $1.5 billion pension contribution, and ended the quarter with a backlog of more than $109 billion.

Lockheed Martin's F-35A in flight.

Lockheed Martin's F-35 is a massive program, but the company has more than just the strike fighter in its portfolio. Image source: Lockheed Martin.

The company also updated its full-year guidance, saying it expects $5.8 billion in operating profits on sales of $53 billion. Both numbers are at the upper end of previous guidance. Lockheed Martin also expects to generate about $3.4 billion in cash in all of 2018.

Expect the momentum to continue into 2019. Lockheed Martin said it expects to grow revenue next year by 5% to 6% from its current 2018 forecast and generate more than $7 billion in cash from operations. It expects to repurchase more than $1 billion in shares by the end of 2019 and pay back $900 million in maturing debt.

LMT Chart

LMT vs. the S&P 500 data by YCharts.

The results validate the confidence investors have shown in Lockheed Martin as shares have soared nearly 140% over the past five years. But is there room for further appreciation? Here's a dive into where the company stands today to try to determine whether Lockheed Martin is a buy.

Broadening the base

Lockheed Martin today is best known for the F-35 Joint Strike Fighter, a trillion-dollar program that figures to account for at least 25% of total company revenue for the foreseeable future. There was a time when investors worried that Lockheed Martin would become overly reliant on the F-35, which has had its fair share of teething issues and is oft-criticized due to its high cost, but the company has done a great job diversifying its portfolio.

One area where Lockheed Martin has excelled is hypersonics, winning more than $1.2 billion in new awards in the quarter to continue development on missiles able to travel at least five times the speed of sound and the interceptors needed to defend against them. In justifying those awards, the Pentagon said, "no other contractor has this level of design maturity," estimating that the government would have been forced to absorb more than $100 million in duplicate development costs had it gone with any bidder other than Lockheed.

Lockheed is also a leader elsewhere in missile defense, maker of the THAAD anti-ballistic systems deployed along the Pacific Rim to counter North Korean threats, and builder of the PAC-3 missile used on the popular Patriot missile defense platform.

Company chairman and CEO Marillyn Hewson on a call with investors following the results said that the large number of buyers of the F-35, coupled with the broad nature of the total Lockheed Martin portfolio, should counter fears about the F-35's prominence.

[The F-35 is] going to continue to sell and it's broad-based. So even though it is a big program relatively speaking, when you consider the customer base, I think that helps mitigate the risk. In addition to that, we're seeing a lot of ... growth in all elements of our business. So every business area contributed to the growth for this quarter and for outlook for the year and we'll continue to see growth. We won a lot of new programs across the business, and they will help to likewise mitigate the risk of one single program. So I feel very comfortable and I'd like to see the F-35 sales continue to grow.

Price discipline

While the new business is exciting, a look at the commentary concerning some of the opportunities that were missed is just as enlightening. Lockheed Martin was among the losers in three high-profile awards late in the quarter that all went to Boeing, deals for a Navy tanker drone, a new helicopter, and an Air Force trainer jet.

Hewson on the call said the losses were a disappointment but indicated Lockheed Martin had no interest in getting into bidding wars. She estimates that had Lockheed Martin matched the winning prices and won the contracts, the company would have incurred a cumulative loss across three programs of more than $5 billion, "an outcome that we do not feel would have been in the best interest of our stockholders or our customers."

It's not unusual for losing bidders to dismiss the winners, and Boeing likely has a different view on the economics of its winning proposals.

But the bottom line is that Boeing, which has had its struggles in defense, needed these wins more than Lockheed Martin did and is taking on some risk by agreeing to firm fixed-price contracts that would put it on the hook for cost overruns. Boeing has taken more than $2 billion in pre-tax charges due to cost overruns for the KC-46 tanker program, another fixed-price deal.

The point for Lockheed Martin shareholders should be that the company is forecasting healthy growth without engaging in cutthroat bidding wars, and without winning everything it goes in for.

Is Lockheed a buy?

Despite its strong five-year run, Lockheed Martin has been a tepid performer of late, slightly trailing the S&P 500 year to date, due to worries about the F-35 and questions about whether the company can sustain its decade-high valuation. We are likely near a peak in government spending, but the company is now providing enough clarity into 2019 and beyond for me to say with confidence that I expect growth to continue into at least the early 2020s.

The company's valuation relative to earnings is in line with competitors Northrop Grumman and Raytheon, despite what appears to be a superior portfolio. Meanwhile, Lockheed Martin's dividend yield, at 2.55%, is best among large defense companies, and with the levels of free cash that it expects to generate, investors are likely to see increased dividends and share buybacks in the years to come.

The questions about the company's portfolio and valuation have been answered. Lockheed Martin is a buy.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.