A chain of errors nearly ended in catastrophe for hundreds of passengers packed into five planes at San Francisco International Airport in July 2017, when the crew of an arriving Air Canada flight mistook a taxiway for a runway, federal aviation officials said Tuesday.

But at the last second, the pilot of Flight 759 realized the mistake and pulled up, coming within just feet of one jet to narrowly avoid what could have been one of the worst aviation disasters in history.

“I don’t want to sensationalize it, but this was a very close call,” National Transportation Safety Board Chairman Robert Sumwalt said during a public hearing in Washington, D.C.

Federal investigators released a report Tuesday documenting the harrowing near miss on July 7, 2017, which was captured on video and prompted changes at SFO. Never before had the NTSB released a full investigative report on an incident that did not result in fatalities, injuries or damage.

“This is an incident which could have resulted in a potential catastrophe,” said John DeLisi, director of the NTSB’s Office of Aviation Safety.

Now Playing:

Weeks after the aborted landing, federal regulators revamped regulations at SFO to require pilots landing at night to do instrument landings for precision guidance of planes when a parallel runway is closed.

In addition, two air traffic controllers must be on duty through the late-night rush of arrivals. One of two air traffic controllers was on a break during the Air Canada incident, NTSB officials said.

The near-disaster occurred as the Air Canada flight out of Toronto — with 135 people on board — descended just before midnight. The crew misidentified the taxiway as a runway because a parallel runway to the pilots’ left had been closed for maintenance and was dark.

Expecting to see two runways, the pilots believed the taxiway on the right was the runway they were supposed to land on, officials said.

Four airplanes — two Boeing 787s, a Boeing 737 and an Airbus 340 — were on the taxiway awaiting clearance for takeoff.

United Airlines pilots in other waiting planes alerted air traffic controllers when they saw the Air Canada plane lowering toward them. The flight crew on a Philippine Airlines jet farther back on the taxiway turned on the plane’s landing lights to alert the Air Canada pilots of an imminent collision, officials said.

It wasn’t until the plane was less than 100 feet from the ground that the pilots noticed the error and initiated a “go-around.”

The NTSB said the plane came within 60 feet of the ground. Video of the near-miss shows the Airbus A320 descending mere feet from the tail of another plane.

The error stemmed from a series of oversights by the crew, pilot fatigue and other safety issues, according to the NTSB report.

SFO officials had put out a report called a notice to airmen, or NOTAM, that advised the Air Canada crew of the closed runway before the flight took off. Another alert was sent out as the plane approached the airport, Sumwalt said.

But the alert about the closed runway was buried in the middle of the report and would not be obvious to a flight crew, officials said.

What’s more, the flight crew failed to manually tune the plane’s instrument landing system frequency, which would have ensured the plane was properly aligned with the correct runway, the NTSB found.

The agency said there was no surface-detection equipment at SFO to identify potential taxiway landings and alert air traffic controllers and pilots.

The crew on the plane, meanwhile, reported feeling tired after being awake “for an extended time,” officials said. While the time they’d been working was in step with Canadian flight and duty time regulations, it would not have met U.S. standards, according to the NTSB.

To avoid similar mix-ups, the NTSB recommended: improving signals to pilots when runways are closed at night; beefing up Canadian regulations to address pilot fatigue; installing updated surface-detection equipment at airports; and equipping airplanes with systems to alert pilots when they are not properly aligned with runways.

Evan Sernoffsky is a San Francisco Chronicle staff writer. Email: esernoffsky@sfchronicle.com Twitter: @EvanSernoffsky