Two passenger aircraft came within 875m of each other at Edinburgh Airport, air accident investigators revealed today.
A Norwegian Air plane arriving from the US touched down two seconds after a Luton-bound EasyJet aircraft took off.
The incident happened while a trainee air traffic controller was being supervised.
The UK Department for Transport's air accidents investigation branch (AAIB) said there had been a "loss of separation between the aircraft at a critical phase of flight".
The Norwegian Boeing 737 was landing at Scotland's busiest airport as the EasyJet Airbus A320 was taking off.
The incident happened at 9:48am on Monday 13 August last year.
The AAIB said: "The airport air traffic control service provider defined this as a runway incursion, as the 737 was over the runway surface when the A320 was still on its take-off roll.
"A combination of factors, including brief delays to the departure of the A320 and the speed of the Boeing 737 being higher than normal, led to the reduction in separation before the controllers became aware of the closeness of the aircraft.
"The trainee controller lacked the experience to resolve the situation in a timely manner and the supervising on-the-job training instructor judged it safer to let the 737 land than to initiate a go-around in proximity to the departing aircraft.
"The air navigation service provider has conducted a review of high-intensity runway operations at Edinburgh and taken a number of safety actions to improve procedures and on-the-job training for trainees."
The AAIB said the airport had an average of 353 aircraft movements a day in 2017, making it the UK's sixth busiest airport.
Its report into the incident stated the Norwegian pilots had seen the EasyJet aircraft and checked with air traffic control (ATC) when they were just under a mile from the runway whether they should abort the landing.
It said: "When they received an instruction to continue their approach, they interpreted this to mean that ATC were fully in control and they followed the instruction accordingly while continuing to monitor the situation.
"The crew of OE-IVC [the EasyJet plane] were not given any instruction to expedite their line up or takeoff by ATC and were unaware of how close EI-FJW [the Norwegian aircraft] was at touchdown."
The report said the trainee controller heard the call made by the Norwegian plane over whether to "go around" rather than land, "but did not hear what they said and so turned to the training instructor for advice.
"He advised to respond 'negative'.
"The trainee controller transmitted 'negative' and 'continue approach' to the crew of EI-FJW."
The AAIB said the training instructor "became aware of the situation a few seconds before the time that EI-FJW called.
"From his perspective, this was when the aircraft appeared to suddenly come out of the cloud.
"He recalled that OE-IVC was at the threshold and had just started its takeoff roll.
"The training instructor admitted that he was surprised to see EI-FJW so close and did not immediately react.
"By the time he was able to do so, he felt that it was too late to stop OE-IVC from taking off as it was beyond the glide path aerials and he was reluctant to send EI-FJW around.
"He feared that this would result in having two aircraft, over which he had limited control, close together in cloud.
"The training instructor explained that with OE-IVC at speed and beyond the glide path aerials during the takeoff and EI-FJW at a very late stage of their approach, he decided the best solution was to allow EI-FJW to land."
A spokesperson for Air Navigation Solutions (ANS), which provides air traffic control at the airport, said: “A range of actions by a number of different parties contributed to create the highly unusual situation at Edinburgh Airport.
"Safety is our number one priority, and we have worked closely with relevant authorities throughout the investigation, and have undertaken a number of measures to ensure our operational and training procedures are robust and effective.
"We continue to review them regularly.”
A spokesman for Edinburgh Airport said: “Safety is absolutely paramount in our operations, a priority shared by ANS, and we have discussed this incident in depth with them.
"We are satisfied the remedial measures put in place are robust and continue to regard safety as the number one priority.”
A Norwegian spokesperson said: “Our flight crews are trained to the highest standards and the safety and security of our customers remains our number one priority.
"The AAIB report concluded that a number of factors led to the loss of separation between aircraft and as such the air navigation service provider has taken necessary steps to mitigate this event occurring again, at no time were Norwegian’s procedures questioned or the safety of our passengers compromised.”
An EasyJet spokesperson said: “easyJet is aware of the report and fully assisted the AAIB with its investigation.
"The safety of our passengers and crew is always easyJet’s highest priority.”