The struggling aerospace giant saw a boost in sales thanks to a rebound in orders for its best-selling 737 MAX jets.

It is scrambling to recoup billions of dollars in lost sales after two fatal crashes forced regulators to ground the plane, in one of the biggest safety scandals in the company's storied century-plus history.

The 737 MAX went back up in the air in some countries at the end of last year, just in time for airlines looking to bulk-up on a mid-sized jet to meet the return of domestic travel.

Boeing's core operating profit was $755 million in the second quarter, compared with a loss of over $3 billion a year earlier.

Revenue rose 44% to about $17 billion.

But the recovery at Boeing is still mid-flight.

While U.S. domestic travel has returned more quickly than expected, Boeing's 737 MAX remains grounded in China, where trade tensions between Washington and Beijing have stunted sales.

It is also struggling with structural defects on its bigger, more profitable 787 Dreamliner models...

And is working through costly repairs and forensic inspections to fix the production-related defects.

It still managed to post that surprise quarterly profit, which sent the stock about 6 percent higher in early Wednesday trading.