With its 737 MAX family grounded indefinitely as investigators try to pin down the causes of two fatal crashes, Boeing (NYSE:BA) desperately needed some kind of win last week.

It got one on Wednesday, as Lufthansa (OTC:DLAKY) placed an order for 20 Boeing 787-9 Dreamliners. The European airline giant also ordered an additional 20 A350-900s from Airbus (OTC:EADSY), adding to the 25 it previously ordered -- of which it has already received 12. These deals will allow Lufthansa to retire most of its fuel-guzzling four-engine jets in the coming years.

Fleet upgrades continue at Lufthansa

As recently as last fall, industry rumors suggested that Lufthansa might want to defer some of its existing widebody aircraft orders, particularly for the Boeing 777-9. A Bloomberg report indicated that the airline group might defer some aircraft but was also thinking about ordering up to 20 smaller widebodies.

Instead, Lufthansa has ordered 40 widebodies -- and it hasn't announced any deferrals so far. Deliveries of the 787 Dreamliners and A350s ordered last week will begin in late 2022 and run through 2027.

A rendering of a Boeing 787-9 in the Lufthansa livery

Lufthansa is ordering 20 787-9s and 20 A350-900s to update its long-haul fleet. Image source: Lufthansa.

Lufthansa hasn't decided how to allocate these jets around its network yet. This is a complex question: In addition to its namesake airline, Lufthansa also owns Austrian Airlines, Brussels Airlines, Eurowings, and SWISS. However, CEO Carsten Spohr has previously said that the company would not operate the 787 and A350 side-by-side at the same hub.

Check out the latest earnings call transcript for Boeing.

Lufthansa will retire most four-engine jets

According to Lufthansa, most of the 787s and A350s it is ordering will replace four-engine planes, which tend to use much more fuel per seat. Indeed, the company estimates that the new aircraft will be about 25% more fuel efficient than the planes they replace, on average. That will be the main driver of an expected 20% reduction in operating costs per seat for the new planes.

Today, Lufthansa operates 32 A340s -- a four-engine widebody that was built primarily in the 1990s and early 2000s -- and its SWISS and Edelweiss Air subsidiaries together have another nine. These planes are already more than 15 years old on average. Lufthansa will likely use the 13 A350s it already had on order plus the aircraft ordered last week to phase out the rest of its A340 fleet by the mid-2020s.

Lufthansa also still operates 13 Boeing 747-400s, which are about 20 years old, on average. The 777-9s that Lufthansa ordered back in 2013 will begin arriving next year, and represent an ideal replacement for the 747-400. Lufthansa also has 19 of the updated Boeing 747-8 model. Even its oldest 747-8 is just seven years old at this point, so this fleet type is probably safe for now. That said, it could be a candidate for early replacement, in light of Lufthansa's growing focus on maximizing fuel efficiency and minimizing emissions.

In a similar vein, Airbus agreed to buy back six of Lufthansa's 14 A380s in conjunction with the A350 sale. These aircraft will be removed from the carrier's fleet in 2022 and 2023. This move may have been the key to Lufthansa's taking delivery of the 20 777-9s it has ordered on schedule, as the 777-9 is the natural twin-engine replacement for four-engine jumbo jets.

Boeing looks like the bigger winner here

As is customary with aircraft orders, the level of discounts was not disclosed. That means it is impossible to be sure about how good the deals were that Lufthansa got from each manufacturer.

That said, Airbus' agreement to buy back six A380s makes it look like Boeing did better here. For one thing, it reduces the likelihood that Lufthansa will defer its 777-9 orders. Additionally, airlines have shown zero interest in used A380s, so the planes Airbus is getting back will probably have to be scrapped for parts. Even the value of the spare parts could decline substantially in the coming years, depending on how many other airlines decide to retire A380s early.

The A350 order -- along with a pending deal to sell 30 A350-900s to Emirates -- will fully offset the impact of Etihad Airways canceling 42 A350 orders last month. Once the new orders are booked, Airbus will have brought in eight net orders for the A350 family in 2019.

Here, too, Boeing is ahead. The U.S. aerospace giant ended February with 18 firm orders for the 787 family year to date. The Lufthansa deal will increase that figure to 38, representing a solid start to the year for Boeing's 787 Dreamliner.