The Federal Aviation Administration on Wednesday changed course and ordered that all Boeing 737 MAX planes flown by US carriers be grounded until further notice over safety concerns following two deadly overseas crashes in less than five months.

“We’re going to be ordering an emergency order to ground all 737 MAX 8 and the 737 MAX 9 and planes associated with that line,” President Trump announced at the White House, a day after federal aviation officials said there was no need to do so.

“Any plane currently in the air will go to its destination and thereafter be grounded until further notice. So planes that are in the air will be grounded, if they’re the 737 MAX, will be grounded upon landing at the destination,” Trump continued.

The FAA said in a statement that “new evidence” analyzed Wednesday contributed to the action — including satellite imagery that showed irregularities in the trajectory of the jet that crashed after takeoff in Ethiopia early Sunday.

Last October, a MAX 8 operated by Lion Air crashed 12 minutes after takeoff from Jakarta, Indonesia.

“It became clear that the track of the Ethiopian flight was very close and behaved very similar to the Lion Air flight,” said the FAA’s acting ­administrator, Daniel Elwell. “Evidence we found on the ground made it much more likely that the flight path was close to Lion Air.”

He said there was no way to know immediately how long the grounding would last.

Sunday’s crash in Addis Ababa killed all 157 people on board, including eight Americans and 18 Canadians.

The Lion Air flight that crashed under similar circumstances took 189 lives.

Boeing said in a statement it “has determined — out of an abundance of caution and in order to reassure the flying public of the aircraft’s safety — to recommend to the FAA the temporary suspension of operations of the entire global fleet of 371 . . . MAX” jets.

Company CEO Dennis Muilenburg also conveyed Boeing’s condolences.

“On behalf of the entire Boeing team, we extend our deepest sympathies to the families and loved ones of those who have lost their lives in these two tragic accidents,” he

said.

Earlier Wednesday, Canada said it was banning MAX jets from its airspace, joining some 40 other nations.

China ordered its airlines to ground the planes — which had 96 MAX jets in service, more than one-fourth of the roughly 370 that had been flying worldwide.

The crashes have already hurt Boeing’s bottom line, with its stock shares set to lose a cumulative $33 billion in market value this week alone, MarketWatch reported.

Southwest Airlines said that the grounded jets represent 5 percent of its fleet and that it would try to keep as many flights on schedule as possible with other equipment.

American Airlines said it has 24 grounded MAX jets.

Norwegian Air, one of the biggest 737 MAX customers, with 110 on order, said Wednes­day it expects Boeing to compensate it for the financial impact of the suspension, The Wall Street Journal reported.

Norwegian has had to cancel 19 flights, including trans-Atlantic flights to the United States that use the 737 MAX 8.