A passenger plane on its way to Edinburgh Airport only missed a drone due to "luck", it is claimed.
The pilot of the Saab 340 was unable to take any action to avoid the drone, which missed the plane by 15ft.
It flew by parallel to the aircraft's flight deck, according to a report on the May 19 incident published this week.
It comes days after aviation watchdogs issued fresh warnings about the danger drones pose to planes.
By flying near an airport the drone pilot had endangered a number of aircraft, aviation experts reported.
In its report, the UK Airprox Board said: "The pilot's overall account of the incident and his inability to avoid the object portrayed a situation where providence had played a major part in the incident and a definite risk of collision had existed.
"It was so close and happened so fast that avoiding action was not possible. The pilot opined that it was only through luck that they did not hit the drone."
The incident happened around 12 miles south of Edinburgh Airport.
There have been at least four incidents in the last nine months where planes narrowly avoided drones at airports in Scotland.
They include a near-miss involving a Thomas Cook passenger jet carrying 200 people at Glasgow Airport.
Pilots union Balpa said even low-speed collisions could be "catastrophic" after the latest study proved drones are capable of smashing through the windscreens of jets.