A West Yorkshire Police helicopter pilot was put in danger when a laser was pointed into the cockpit as it flew above Leeds.
James Kenworthy was arrested at his home in Kirkstall after he admitted shining the laser pen at the aircraft from his attic window.
Leeds Crown Court heard the pilot had to take evasive action and put on protective goggles as the laser "pulsed" inside the aircraft.
Carmel Pearson, prosecuting, said the helicopter was at flying 1,500ft above Kirkstall as it was being returned to base when the incident happened at 2am on August 29 this year.
The pilot managed to manoeuvre the aircraft away from the laser during the incident which lasted three minutes.
Miss Pearson said there was only one pilot on board which would have made the situation even more serious if he had been incapacitated.
The pilot managed to point the helicopter's camera towards the house where the laser beam was coming from.
Police officers on the ground arrived at Kenworthy's home ten minutes later and arrested him.
Kenworthy immediately admitted to police that he was the culprit.
The laser was recovered from the property.
The defendant told officers he had bought it on eBay.
He also admitted to pointing the laser at aeroplanes as they approached Leeds Bradford Airport.
Kenworthy, of Adwick Place, Kirkstall, pleaded guilty to an offence of pointing or directing a laser towards an aircraft.
Probation officer Mick Berry said Kenworthy suffered from mental health issues due to his prolonged use of amphetamines.
Mr Berry said Kenworthy was also struggling to cope following the death of his mother.
Eddison Flint, mitigating, said Kenworthy initially thought the helicopter was a drone when he first aimed the laser but then realised it was an aircraft.
Kenworthy was given a six-month prison sentence, suspended for two years.
He was also made the subject of a six-month drug treatment order.
Judge Rodney Jameson, QC, said: "Nobody could think a full scale helicopter could be a drone."