A drone the size of a football was flown as close as 20 metres from a passenger jet, according to an official investigation in England.
The Airbus A320's first officer shouted "look!" as the device passed next to the right wing at around 11,000ft above south-east London, the UK Airprox Board (UKAB) said.
A minority of drone operators are "flagrantly disregarding regulation and common sense" in pursuit of "ever more spectacular video footage", the board warned.
The incident involving the A320 was assessed as having the most serious degree of risk.
There was insufficient time for the flight crew to take action to avoid a potential collision with the drone, which had a flashing magenta light.
It was at the same altitude and passed just 20 to 40 metres from the aircraft.
Air traffic control was immediately alerted to the near miss which occurred at 6.05pm on August 4, when the airliner was in a holding pattern over Biggin Hill used for flights approaching Heathrow Airport.
Details were passed to the Metropolitan Police but the drone operator could not be traced.
The UKAB concluded that the person flying the drone had endangered the A320 and its occupants while flying in restricted airspace without permission.
British Civil Aviation Authority rules also state that drones should not be flown above 400 feet.
A collision "had only been narrowly avoided" and chance had played a "major part", the report noted.