After nearly two years and a pair of deadly crashes, the Federal Aviation Administration has cleared Boeing’s 737 Max for flight.

The nation’s air safety agency announced the move early Wednesday, saying it was done after a “comprehensive and methodical” 20-month review.

Regulators around the world grounded the Max in March 2019, after the crash of an Ethiopian Airlines jet. That happened less than five months after another Max flown by Indonesia’s Lion Air plunged into the Java Sea. A total of 346 passengers and crew members on both planes were killed.

The planes won’t return to the skies for a while. The FAA said it must approve pilot training changes for each U.S. airline and airlines must perform required maintenance on the planes.

The FAA said the move was made in cooperation with air safety regulators worldwide. “Those regulators have indicated that Boeing’s design changes, together with the changes to crew procedures and training enhancements, will give them the confidence to validate the aircraft as safe to fly in their respective countries and regions,” the FAA said in a statement.

The move came after numerous congressional hearings on the crashes that led to criticism of the FAA for lax oversight and Boeing for rushing to implement a new software system that put profits over safety and ultimately led to the firing of its CEO.

Investigators focused on anti-stall software that Boeing had devised to counter the plane’s tendency to tilt nose-up because of the size and placement of the engines. That software pushed the nose down repeatedly on both planes that crashed, overcoming the pilots' struggles to regain control. In each case, a single faulty sensor triggered the nose-down pitch.

The FAA required Boeing to change the software so it doesn’t repeatedly point the nose of the plane down to counteract possible aerodynamic stalling. Boeing said the software also does not override the pilot’s controls like it did in the past. Boeing also must install new display systems for pilots and change the way wires are routed to a tail stabilizer bar.

Boeing’s redemption comes in the middle of a pandemic that has scared away passengers and decimated the aviation industry, limiting the company’s ability to make a comeback. Air travel in the U.S. alone is down about 65% from a year ago.

Boeing sales of new planes have plunged because of the Max crisis and the coronavirus pandemic. Orders for more than 1,000 Max jets have been canceled or removed from Boeing’s backlog this year. Each plane carries a sticker price between $99 million and $135 million, although airlines routinely pay far less than list price.

John Hansman, an aeronautics professor at MIT, said people typically avoid airplanes for a few months after there are problems. But the Max case is unusual, and were it not for the novel coronavirus, Hansman said he would feel safe flying on a Max.

“This whole thing has had more scrutiny than any airplane in the world,” he said. “It’s probably the safest airplane to be on.”

American is the only U.S. airline to put the Max back in its schedule so far, starting with one round trip daily between New York and Miami beginning Dec. 29.