Boeing landed its first quarterly profit since 2019 on higher defense earnings and a recovering commercial aviation market that will enable the company to cut fewer jobs than initially planned, according to results released Wednesday.

Shares surged on the results, which surprised analysts who had projected another loss, and comes as commercial airlines pivot to meet surging travel demand in a partially recovered travel market as Covid-19 vaccines have become available.

Still, the aviation giant continues to face uncertainty due to the pandemic, challenges due to halted deliveries of a best-selling jet and an uncertain outlook for plane orders in China.

"We continued to make important progress in the second quarter as we focus on driving stability across our operations and transforming our business for the future," said Boeing Chief Executive Dave Calhoun in a press release.

"While our commercial market environment is improving, we're closely monitoring COVID-19 case rates, vaccine distribution and global trade as key indicators for our industry's stability."

Boeing reported a second-quarter profit of $587 million, compared with a loss of $2.4 billion in the same three months of 2020 at the height of the pandemic.

Revenues rose to $17 billion, up 44 percent from a year earlier, and the company saw higher operating earnings in defense, space and security.

It also saw a much smaller quarterly loss in its commercial plane division, thanks largely to the resumption of deliveries of the 737 MAX that were suspended after the 20-month grounding following two fatal crashes.

Boeing also swung to a profit in its global services business after the division had a loss last year as a result of Covid-19 costs.

The commercial aviation recovery is "accelerating, but remains uneven," with travel restrictions on international travel continuing to challenge demand for long-distance aircraft, according to a company presentation that cautioned a full recovery is not expected until 2023 or 2024.

Despite the continued challenges, Calhoun told CNBC in an he felt sufficiently confident about the market to shift plans on a previously announced downsizing.

Boeing shares surged after it reported a surprise profit and said it would cut fewer jobs than previously expected
Boeing shares surged after it reported a surprise profit and said it would cut fewer jobs than previously expected AFP / Jason Redmond

The company now plans to keep its workforce at the current 140,000, rather than cutting to 130,000 as announced earlier in the pandemic.

While the latest wave of Covid-19 cases is "not helpful," Calhoun does not expect "severe repercussions" from the Delta variant.

"I still think we are completely dependent on distribution of that vaccine and penetration of the vaccine in every population," Calhoun told the network.

Despite the better results, the manufacturer still faces questions over its operations, most recently with the 787 Dreamliner. Boeing halted deliveries of the jets and lowered production levels while it makes additional alterations on the plane.

Another uncertainty is the state of Boeing's business in China, which remains the only major country yet to approve the MAX to return to service.

Calhoun said efforts with Chinese officials have "been constructive" and are "moving forward."

He has been urging the Biden administration to promote good trade relations with Beijing in the expectation that Chinese carriers will order more planes next year

"The order book hasn't gone to the other guy yet," Calhoun said in a reference to European rival Airbus. "Our government is well aware that if we cede the Chinese market, the Europeans will simply fill in. And that will be the difference between world leadership or not.

"And that represents roughly a million jobs in our supply chain, including the Boeing assembly operations."

Peter McNally, an analyst at Third Bridge, attributed the better results mainly to the improvement in the defense business.

"Things aren't getting worse for Boeing for the first time in a long time," he said . "They set a low bar. There are still areas for improvement."

Shares jumped 5.5 percent to $233.38 in early trading.