Two Qantas passenger aircraft were just seconds from colliding when they came within 220 metres of each other near Adelaide.
Collision avoidance systems were set off as a Sydney-to-Perth plane came too close to a Perth-to-Sydney plane over the Great Australian Bight on Friday afternoon.
The plane travelling from Sydney had been granted permission by air traffic control to climb.
An air traffic controller has reportedly been stood down over the incident.
Passenger Gary Martin witnessed the near miss.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
"There was nothing reported; I just happened to look out the window somewhere in South Australia and saw a plane fly underneath," he told reporters at Perth Airport.
But many other passengers arriving at the airport were unaware of the near miss and believed the flight was normal.
Qantas says the Airbus A330 aircraft had a "loss of separation".
"Our pilots followed standard operating procedures in re-establishing the required separation distance," the airline said in a statement.
The Australian Transport Safety Bureau (ATSB) has begun an investigation which will include examining radar and audio data and interviewing air traffic controllers and flight crew.
It said the incident occurred just after midday (AEST), 19 kilometres west of Adelaide, when the flight one plane had begun to climb from 38,000 feet to 40,000 feet after being cleared to do so.
"Soon after, the controller cancelled the clearance and the aircraft descended back to 38,000 feet," the ATSB said.
It said the flight crew of the second plane received a resolution advisory alert from the aircraft's traffic collision avoidance system, requiring immediate action.
The ATSB said it expected to complete the investigation of the incident this month.
The West Australian newspaper's aviation editor Geoffrey Thomas said all passengers would have died if the planes collided.
"From an accident like that there would be no survival whatsoever," he told the Seven Network.

