Boeing (BA) stock initially slipped as much as 1 percent Tuesday after President-elect Donald Trump tweeted that the cost of a new Air Force One jet was too high and that the government should cancel its contract with the aerospace giant. By early afternoon, the shares had mostly recovered their near-billion-dollar loss -- but what a ride for the company and its shareholders.

“Boeing is building a brand new 747 Air Force One for future presidents, but costs are out of control, more than $4 billion. Cancel order!” Mr. Trump’s tweet said. (President Barack Obama’s spokesman later said -- while traveling aboard Air Force One -- that the White House had no idea where Mr. Trump got that figure.)

Boeing is building a brand new 747 Air Force One for future presidents, but costs are out of control, more than $4 billion. Cancel order! — Donald J. Trump (@realDonaldTrump) December 6, 2016

“The plane is totally out of control,” Mr. Trump said in a brief media appearance in the lobby of Trump Tower following his early-morning tweeting. “I think Boeing is doing a little bit of a number. We want Boeing to make a lot of money, but not that much money.”

Get Breaking News Delivered to Your Inbox

Like other defense stocks, Boeing’s had risen since Mr. Trump won the election, up by 7 percent through Monday’s market close. Until the president-elect’s tweet appeared early Tuesday, the company’s pre-market price was unchanged, then promptly slid 1 percent.

There likely will end up being two new Air Force One aircraft in service when the replacements are slated to start flying in 2023, both 747-800s. Right now, the president has two of the older 787-200 series.

It’s unclear how accurate Mr. Trump’s information is on how much the new flying White Houses will cost. The only money earmarked for the Air Force One project is $170 million for Boeing’s initial design and engineering work -- although the company stands to make billions on it in the future.

“Some of the statistics that have been cited, shall we say,don’t appear to reflect the nature of the financial arrangement

between Boeing and the Department of Defense,” White House spokesman Josh Earnest told reporters flying with Mr. Obama..

A Defense Department official said that, in all, there is $2.7 billion for Air Force One authorized in a Pentagon spending bill passed by the House of Representatives and pending before the Senate. How solid is the government’s commitment to Boeing to build the plane? Very solid. No one can foresee the government awarding the contract ultimately to, say, Airbus, the European aerospace consortium. The Defense official said that, as the project moves into later stages, either Boeing or the government could walk away, or seek modifications.

Bloomberg News pegged the total cost for the two new planes at $3.2 billion. A standard 747-800 costs an average of $380 million.

“We are currently under contract for $170 million to help determine the capabilities of this complex military aircraft that serves the unique requirements of the President of the United States,” Boeing spokesman Todd Blecher said in statement. “We look forward to working with the U.S. Air Force on subsequent phases of the program, allowing us to deliver the best plane for the president at the best value for the American taxpayer.”

Certainly, the trappings of Air Force One are superior to any private or commercial jetliner. The aircraft is laden with sophisticated electronics and is meant to function as an aerial command post during a war, including anti-missile defenses.

Mr. Trump bought his personal plane, a Boeing 757, in 2010 from Microsoft (MSFT) billionaire Paul Allen, and set about renovating it. His total outlay is a reported $100 million. Its interior features Mr. Trump’s signature gold fixtures and trim. The plane first flew in 1991 for a Danish airline, which later sold it to a Mexican carrier. Both of them are now defunct. Allen bought it in 1995.