An Air Canada flight with 140 people on board came within 30m (98ft) of other aircraft at San Francisco's airport as it prepared to land, a report says.
Flight AC759 from Toronto was cleared to land on 7 July but the pilot "inadvertently" headed for a taxiway where four aircraft were due to depart.
The error was spotted by an air traffic controller, who ordered the pilot to pull up and make another approach.
The Airbus 320 then circled and landed safely. No injuries were reported.
As the plane approached the taxiway, which runs parallel to the runway, it is estimated that it flew just 30m above two aircraft waiting to depart, a preliminary report by Canada's Transportation Safety Board (TSB) said.
After receiving a warning, the pilot pulled up and the plane rose about 60m above a third jet and about 90m above a fourth, the TSB said.
Flight AC759 had already travelled almost 400 metres over the taxiway before aborting the landing, the board's report added.
'Where's this guy going'
An investigation into the incident by the US Federal Aviation Administration (FAA) is ongoing. The FAA described the near-miss as "very rare".
- Drone operator in 'near miss' with Flybe flight
- Flight diverts after suspected bird strike
- Plane lands after 'shaking like washing machine'
Air Canada said that 135 passengers and five crew members were on the flight from Toronto.
It is not clear how many people were in the four planes on the taxiway.
The taxiway, which provides lanes for aircraft to travel between runways and terminals for both landing and takeoff, are distinguished by different coloured lights.
Earlier, an audio recording was released of what was said to be communication between air traffic controllers and pilots at San Francisco's airport on 7 July.
In it, a male voice believed to be that of the Air Canada pilot is heard saying that there are lights on the runway.
One of the air traffic controllers replies that there are no other planes there.
Another - unidentified - voice is then heard saying: "Where's this guy going? He's on the taxiway."
The air traffic controller then apparently realises the danger of the Air Canada plane crashing into the four aircraft on the ground, and orders the pilot to pull up and make another approach.
A pilot from one of the planes on the ground is heard saying: "United One, Air Canada flew directly over us."
An Air Canada spokeswoman, Angela Mah, said the airline was investigating the incident and was "co-operating with the authorities", local media report.