The world's largest defense contractor delivered outstanding fourth-quarter results and tepid 2019 guidance, perfectly encapsulating the two competing forces tugging on defense stocks. For investors with a long enough time horizon, it looks like a great time to buy into Lockheed Martin (NYSE:LMT).

Defense stocks have been some of the top performers of the past five years because of Pentagon modernization efforts and increased funding both in the U.S. and among NATO allies, but that performance has fallen off of late over worries that future budget increases won't be so easy to come by. Lockheed Martin has been part of that trend: The company's shares have nearly doubled over the past five years but were among the market's worst performers over the last three months of 2018.

The company in its fourth-quarter earnings release made the case for why the concerns that are eating at the share price are overblown. Here's a look at where things stand for Lockheed Martin, and why you should consider adding this stock to your portfolio.

Firing on all cylinders

Lockheed Martin reported fourth-quarter earnings of $4.39 per share, just missing the $4.40 consensus estimate, as better-than-expected operating results were shaved by a higher-than-expected tax rate and an asset impairment charge. Revenue, at $14.4 billion, came in well above the $13.75 billion consensus estimate.

Check out the latest Lockheed Martin earnings call transcript.

Lockheed Martin F-22 and F-35 together in flight

Lockheed Martin is best known for warplanes including the F-22 and F-35, but has a well-rounded portfolio. Image source: Lockheed Martin.

Every segment of the company met or exceeded revenue expectations, led by missiles and fire control, up 22% to $2.43 billion, thanks to classified work and continued orders for its missile defense programs. Aeronautics revenue, meanwhile, rose 4%, thanks to higher volume F-35 production, though that segment's profitability was hit by lower C-130 transport volumes. Space was up 4%, to $2.49 billion, on classified work and development on the Orion long-duration deep-space exploration project.

Lockheed also said it grew its backlog by nearly 20% in the quarter, finishing December with $130 billion on the books, compared with $109 billion at the end of the last quarter.

Despite the growth, the company remains conservative going into 2019, saying it expects to earn between $19.15 and $19.45 per share, compared with a consensus estimate of $19.57 per share. Some of that might be skepticism about lawmakers' ability to get the fiscal 2020 government budget completed. Lockheed added language addressing "the impact of government shutdowns" to its list of factors affecting forward-looking statements.

Many ways to win

Lockheed's quarter reflects the strength of its portfolio and the company's exposure to numerous areas of Pentagon emphasis. The F-35 is finally reaching maturity and is well on its way to becoming the trillion-dollar flagship program Lockheed investors had hoped for. The company is also a key cog in the U.S. missile and missile defense strategy, thanks to its Aegis combat management system and Terminal High Altitude Area Defense anti-ballistic batteries.

The company, moreover, has perhaps the most exciting portfolio of new business in the industry. Lockheed, for example, last year won more than $1.4 billion in hypersonic contracts. Hypersonics, missiles that are able to travel more than five times the speed of sound, are an area of particular Washington interest because of Chinese and Russian advances. Other new or ramping-up work include a new joint-air-to-ground missile designed to eventually replace U.S. Army and Navy inventories of Airborne TOW, Maverick, and Hellfire armaments, and a $585 million contract to provide a new missile defense radar for Hawaii.

Lockheed historically has been conservative when issuing guidance, and the 2019 earnings-per-share outlook, though 10% higher than 2018 results, should give the company low hurdles to surpass in the quarters to come. Lockheed Martin also expects cash from operations of at least $7.4 billion in 2019, leaving room for buybacks and plenty of flexibility for Lockheed -- which already boasts the highest dividend yield among defense primes -- to later in the year continue its recent history of 10%-plus annual dividend increases.

LMT Dividend Yield (TTM) Chart

Defense Dividend Yields (TTM) data by YCharts

A long-term outperformer

Lockheed Martin is in an odd position where there's more uncertainty about the company's near-term prospects than for its longer-term outlook. For investors with a tolerance for some short-term headline risk and a multi-year perspective, this is a great stock to own.

As the company notes, the potential for further government shutdowns or a disrupted fiscal 2020 Pentagon appropriation is a significant concern. Chairman and CEO Marillyn Hewson, during a conference call with investors, urged lawmakers to work out a deal, saying, "We are hopeful that fiscal year 2020 funding will be in line with, or better than, prior presidential budget request[s] and that it will continue to emphasize recapitalization of our nation's defense assets and the research and development that is critical to maintain our country's future security."

But if the circumstances that led to the recently ended partial government shutdown is any indication, a quick resolution seems unlikely.

Lockheed Martin will also have to juggle its mix of newer, and typically lower-margin, programs such as hypersonics with more mature programs such as the F-35, and it risks having a quarter where margins don't hit expectations because of delivery schedules. That could put a damper on some future quarterly results but shouldn't change the longer-term outlook for the businesses.

Among the large defense contractors, no company can match Lockheed Martin in terms of winners in its portfolio and exposure to Pentagon priorities. It's hard to predict what will happen in Washington over the months to come. But for those who can ignore the near-term noise, Lockheed Martin is a great addition to the portfolio.