The untraced drone came 75ft feet from the Airbus A319 passenger plane as it was descending shortly after noon on 25 November last year.
The UK Airprox Board, which investigates reports of near misses, rated the incident as a highest-level category A, where a "serious risk of collision has existed".
It also reported a similar near miss three days earlier near Kilmarnock involving an aircraft heading to Glasgow Airport.
The board said the Edinburgh incident happened at 3,700ft, with the drone being operated beyond the line of sight and flown into conflict with the A319.
The board said the pilot of the medium-size passenger aircraft reported "being in the descent, coasting out, when they came very close to what appeared to be a drone."
It said: "The crew noticed it quite late, as it appeared in the 11 o'clock position and passed down the left side of the aircraft at the same level.
"The pilot noted that there was no time to take avoiding action.
"The incident was reported to the controller and to police on landing."
It concluded: "Acknowledging the difficulties in judging separation visually without external references, the board considered tthe pilot’s estimate of separation, allied to his overall account of the incident, portrayed a situation where collision had only been avoided by providence.
"The A319 pilot had not been able to take avoiding action and so the board therefore determined the risk to be Category A."
The board said the maximum height that drones could be flown so visual contact was maintained to avoid collisions was 400ft.
They must also avoid and give way to other aircraft in controlled airspace, such as near airports.
The board said: "Drones of any size that are operated in close proximity to airfield approach, pattern of traffic or departure lanes, or above 1,000ft can be considered to have endangered any aircraft that come into proximity.
"In such circumstances, the drone operator will be judged to have caused the airprox [air proximity hazard] by having flown their drone into conflict with the aircraft."
In the Kilmarnock incident, on 22 November, the crew of an Airbus A320 flying at 6,000ft spotted a 50cm drone, which passed down the left side of the aircraft, slightly below it, before they had a chance to take avoiding action.
The pilot estimated the drone had passed 400ft from the plane, and airprox board said "safety was not assured", giving the incident a category B rating.
In March last year a drone came 100ft from hitting a Ryanair aircraft landing at Glasgow Airport, in the first such case in Scotland.
The airprox board said there had been a "definite risk of collision” with the Boeing 737 arriving from Derry.