The United States grounded all Boeing 737 Max 8 planes on Wednesday following two deadly crashes involving the aircraft in the past five months.

President Donald Trump announced on Wednesday that he would issue an order to ground all Boeing 737 Max aircraft, effective immediately.

Canada, the European Union, and several other countries and airlines also grounded the jet this week following the crash of an Ethiopian Airlines 737 Max 8 on Sunday.

American Airlines, Southwest Airlines, and United Airlines operate the aircraft in the US.

The United States on Wednesday joined Canada, the European Union, and several other countries and airlines in banning the Boeing 737 Max aircraft from its airspace following Sunday's Ethiopian Airlines crash that killed 157 people.

President Donald Trump said he would issue an order to ground all 737 Max aircraft, effective immediately.

"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," Trump said. "Any plane currently in the air will go to its destination and thereafter be grounded until further notice."

Several US lawmakers had called for grounding the plane.

In a statement, Boeing said it recommended to the Federal Aviation Administration that the 737 Max be grounded "out of an abundance of caution and in order to reassure the flying public of the aircraft's safety."

Wednesday's decision marked an about-face for the FAA, which had said as late as Tuesday evening that it saw no reason to ground the 737 Max aircraft operating in the US.

A Southwest Airlines Boeing 737 Max 8. Southwest Airlines

There are 371 Boeing 737 Max aircraft in operation around the world.

The US is the last major operator of the 737 Max to ground the aircraft type. China, which has the most Max aircraft, grounded its fleet on Monday. The Europe Union on Tuesday banned the plane from its airspace.

Read more:: 2 Boeing 737 Max airliners have crashed since October — here are the airlines that fly the plane

The 737 Max's major US customers include Southwest Airlines, American Airlines, and United Airlines. Southwest is the 737 Max 8's largest customer, with 34 planes in its fleet. American operates 24 of the aircraft, while United flies 14 of the larger 737 Max 9 variant.

"Earlier today the Federal Aviation Administration (FAA) informed us that based on new information, they are grounding the United States Boeing 737 MAX fleet out of an abundance of caution," American Airlines said in a statement to Business Insider. "Our teams will be working to rebook customers as quickly as possible, and we apologize for any inconvenience."

Southwest and United were not immediately available for comment.

A United Airlines Boeing 737 Max 9. United Airlines

Ethiopian Airlines Flight ET302 crashed shortly after taking off from Addis Ababa Bole International Airport on Sunday, killing all 157 passengers and crew members on board the four-month-old plane.

It was the second nearly brand-new Boeing 737 Max 8 airliner involved in a fatal crash in recent months. In October, Lion Air Flight JT610 crashed in the Java Sea shortly after taking off from Jakarta, Indonesia, killing all 189 people on board.

On Tuesday, Boeing announced it would roll out an updated version of the 737 Max's control software in the coming weeks. It said the update has been in the works since the Lion Air crash.

The Wall Street Journal reported on Tuesday that the implementation of the software was delayed by the 35-day government shutdown from late December to January.

Ethiopian police officers walk past the debris of the Ethiopian Airlines Flight 302 plane crash, near the town of Bishoftu, near Addis Ababa. Reuters

At the heart of the controversy surrounding the 737 Max is its Maneuvering Characteristics Augmentation System, or MCAS.

To fit the Max's larger, more fuel-efficient engines, Boeing had to redesign the way it mounts engines on the 737. This change disrupted the plane's center of gravity and caused the Max to tend to tip its nose upward during flight, increasing the likelihood of a stall. The system is designed to automatically counteract that tendency and point the nose down.

Initial reports from the Lion Air investigation indicated that a faulty sensor reading may have triggered the system shortly after takeoff. Observers fear that a similar thing happened during the Ethiopian Airlines flight.

The Boeing 737 is the best-selling airliner of all time. Since 1965, the American aviation giant has taken orders for a whopping 15,000 737s.

Over the years, Boeing has introduced four distinct generations of the 737, the latest being the 737 Max that entered service in 2017.

Boeing has orders for roughly 5,000 737 Max jets, making it the fastest-selling plane in the company's history.

The cockpit of a 737 Max. Boeing

Boeing lists the 737 Max 8 at $121.6 million. But according to industry research from Teal Group, buyers usually receive a discount of 50% to 55% on the planes.

The 737 Max is built alongside the previous-generation 737NG (Boeing 737-600, -700, -800, and -900) at Boeing's factory in Renton, Washington.

By the end of last year, Boeing had ramped up production of the 737 to 52 aircraft a month. It said it planned to produce 57 a month this year.

Last year, Boeing delivered 256 Max aircraft to customers, representing nearly half of all 737 deliveries.

Boeing Commercial Airplanes, the company's airliner division, has a backlog of 5,870 planes — including 4,699 737s — valued at more than $400 billion.