Boeing (BA -1.02%) has been one of the best-performing large-cap stocks of 2017, with shares up more than 35% year to date. On Wednesday, it backed up those big gains with strong earnings for the second quarter of 2017, despite a significant year-over-year decline in commercial airplanes deliveries.

Most impressively, free cash flow nearly doubled last quarter, continuing on its strong trajectory. Boeing's cost-cutting program is paying big dividends, while the 787 Dreamliner is finally becoming a reliable cash cow. Moreover, the company raised numerous aspects of its full-year guidance.

Q2 by the numbers

Last quarter, revenue plunged 8.1% year over year, as the company reduced deliveries across several of its commercial jet families. However, Boeing was able to avoid incurring any major earnings charges, something that had plagued it during 2016. Furthermore, its underlying operational performance continues to improve.

 Metric

Q2 2017

Q2 2016

Year-Over-Year Change

Revenue

$22.7 billion

$24.8 billion

(8.1%)

Commercial Airplanes Deliveries

183

199

(8%)

Core Operating Margin

9.7%

(2%)

N/A

Free Cash Flow

$4.5 billion

$2.5 billion

79%

Core EPS

$2.55

($0.44)

N/A

Total Order Backlog

$482 billion

$472 billion

2.1%

Data source: Boeing Q2 earnings releases. Chart by author.

The result was a strong 9.7% core operating margin, close to the company's goal of generating double-digit margins. Boeing's core EPS reached $2.51 (compared to a loss in the prior-year period), beating even the most optimistic analysts' expectations.

Dreamliner profitability is rising quickly

Boeing's free cash flow generation of $4.5 billion was especially impressive. Some of the $2 billion increase was driven by the impact of Boeing's companywide cost-cutting program. That said, improving profitability of Dreamliner production also played a major role.

A year ago, Boeing wasn't even breaking even on the Dreamliner. Since then, the delivery mix has shifted further toward the more profitable 787-9 variant, while production efficiency continues to rise.

A Boeing 787-9 aircraft

The 787-9 now accounts for the vast majority of Dreamliner output. Image source: Boeing.

As a result, Boeing is now generating strong cash profits on the 787 family. During the second quarter, the deferred production balance for the 787 program slipped by $531 million. Meanwhile, the amount of unamortized tooling costs fell by $191 million. The sum of those two figures ($722 million) is a rough proxy for the cash profits generated by Dreamliner production.

Dreamliner profitability is set to rise even further in the coming years. Production will increase somewhat in the second half of 2017, spreading overhead costs over a larger number of deliveries. In 2018, Boeing will begin delivering the larger (and even more profitable) 787-10 variant. Lastly, production of the low-margin 787-8 will soon decrease to a negligible amount.

Guidance flies higher

In light of its strong second quarter performance and solid outlook, Boeing has increased several pieces of its financial guidance for 2017. Boeing bumped up margin estimates for each of its business segments and revised its expected effective tax rate for the year down from 31% to 29%. As a result, core EPS is now expected to reach a range of $9.80-$10.00, compared to a prior estimate of $9.20-$9.40.

The biggest change related to cash flow. Boeing now expects to generate at least $12.25 billion of operating cash flow in 2017, up by $1.5 billion from its previous estimate.

About half of this increase ($700 million) comes from expected tax benefits related to Boeing's decision to contribute $3.5 billion of stock to its pension plan this quarter. The rest of the increase reflects strong operating performance, as seen in Boeing's stellar second-quarter cash flow. Boeing also reduced its capex guidance by $300 million, providing a further boost to free cash flow.

Boeing's cash flow trajectory should strengthen further as 737 MAX deliveries ramp up over the next three years or so and Dreamliner profitability continues to improve. Boeing stock isn't cheap anymore, but the company's strong cash flow prospects probably justify its buoyant share price.