The pilot of an Air Canada plane carrying 140 passengers made a last-minute maneuver to avoid landing on a taxiway at San Francisco International Airport where four passenger jets were lined up to take off.

Federal officials said on Tuesday they are investigating why the pilot mistakenly made his approach toward the taxiway instead of the runway just to the left. An air traffic controller ordered the Airbus 320 to abort and circle for another landing, which it did without incident Friday night.

Aviation-safety consultant Todd Curtis said it was “definitely a serious event since a landing on an active taxiway could lead to a catastrophic accident.”

In audio posted on liveatc.net, which records flight communications, the pilot on the plane from Toronto and the air traffic controller sounded calm as the close call unfolded.

At first, the pilot said he sees “some lights on the runway,” apparently alluding to planes on the taxiway, the aviation equivalent of feeder roads that planes use to roll between runways and terminals.

The controller assures the pilot there is no one on the runway. Seconds later, another voice apparently one of the pilots on the taxiway interjects, “Where’s this guy going? He’s on the taxiway.”

The controller orders the Air Canada jet to “go around,” and the pilot acknowledges the command.

Roughly 30 seconds later, a United Airlines pilot on the taxiway says the jet “flew directly over us.”

Federal Aviation Administration spokesman Ian Gregor would not comment on how close Air Canada Flight 759 came to disaster, citing his agency’s ongoing investigation.

The National Transportation Safety Board also will review what happened.

“Any time you have an incident where there’s a potential for a catastrophic event, we take an interest,” spokesman Keith Holloway said.

It is rare for pilots to mistake a taxiway for a runway, and when it happens, it usually involves small planes at smaller airports. Taxiways do not have the same distinctive markings and lighting as runways.

Earlier this year, actor Harrison Ford flew over an airliner and landed his small plane on a taxiway at John Wayne Airport in Southern California. The FAA did not sanction Ford.

Collisions on the ground are particularly dangerous because planes waiting to take off are loaded with fuel. The worst crash in aviation history occurred in 1977 when a KLM Boeing 747 taking off in the Canary Islands plowed into a Pan Am 747 that was waiting to take off; 583 people died in the crash and fires.

In December 2015, an Alaska Airlines Boeing 737 landed on a central taxiway at Seattle-Tacoma International Airport. No one was injured.

The San Francisco incident, which Air Canada says it too is examining, was first reported Monday by the Bay Area News Group.

It happened in clear weather and with the pilot not the plane’s autopilot in control. Under these “visual flight rules,” pilots must distinguish between runways and taxiways using their eyes, experience and available data from onboard computers.

Curtis, the safety consultant, said it was impossible to know how often commercial pilots line up their landing for a taxiway instead of a runway because government databases only capture that if there is an accident or serious incident.

Other aviation safety experts noted that while safety systems did work in the end, the incident was serious and could have been calamitous.

Investigators will focus on “how did this series of errors occur, and why didn’t safeguards kick in earlier than they did?” said John Cox, a safety consultant and retired airline pilot.

Cox said it was likely that even if the air traffic controllers didn’t order the Air Canada plane to pull up and make another approach, the crew would have seen planes on the taxiway in time to avoid landing on them.

Investigators will be able to determine the Air Canada plane’s altitude and exact location using the flight-data recorder.

Chris Manno, an American Airlines pilot for 32 years who regularly lands in San Francisco, agreed that a crash was unlikely even without a command to go around.

The pilot “is not just blindly going to say, ‘I’m going to land on these aircraft,’” Manno said.

A spokesman for San Francisco’s airport declined to comment.