An air ambulance regularly piloted by the Duke of Cambridge "narrowly avoided" a collision with a remote-controlled drone, according to an official report.
The helicopter, which the royal was not in at the time, avoided a potentially deadly mid-air crash with the remote-controlled machine by "chance", 1,900ft above north London last August.
Investigators found there had been a "high" risk of the two aircraft coming into contact, "endangering the EC145 and its crew" over a busy area.
A report into the near-miss by the UK Airprox Board, which probes such incidents to improve air safety, suggested the drone was flying above its permitted altitude.
The Eurocopter 145, which is used by the East Anglian Air Ambulance (EAAA), has been flown repeatedly by William during his work for the service.
A EAAA spokeswoman said: "The Duke of Cambridge was not on shift when the drone incident took place."
The drone pilot was never found, the review said.
In January, William said he would be leaving his role as a pilot to spend more time in London, where his children will be schooled.
The narrow miss with the drone had taken place several months before, however, at 7.45pm on August 26.
It had passed within 30 metres of the air ambulance, which was carrying medics at the time, close enough for the crew to see the dark, four-bladed quadcopter, the report said.
In its findings, which concluded the incident was the highest category of risk, Airprox said: "Members agreed that the drone was apparently being operated over a built-up area without CAA (Civil Aviation Authority) permission, was above the altitude where it could be considered in direct unaided line of sight and, if using FPV (first-person view), was above the 1000ft allowed by regulation.
"They therefore agreed that this could be considered as endangering the EC145 and its crew in that the drone had been flown into conflict.
"Notwithstanding the difficulty of visual assessment of range without visual cues, when allied to the pilot's overall account of the incident the board considered that the reported range was such that this was a situation where a collision had only been narrowly avoided and chance had played a major part.
"They therefore determined the risk to be Category A."
The ambulance control room was contacted by the worried pilot, telling them to inform the police, it added.
A spokeswoman for EAAA said: "We can confirm that, in accordance with aviation regulations and procedures, a pilot reported a drone in his proximity on August 26, 2016.
"The Duke of Cambridge was not on shift when the drone incident took place.
"There are strict rules that drone operators must follow and it is important they are aware of their responsibilities for safe operations at all times."