A HAPLESS gang who packed drugs to a drone in a doomed prison smuggling attempt were nailed after filming themselves.

Paul Reilly, 32, and Michael Martin, 35, accidentally shot 18 minutes of footage stashing cannabis and pills in choccy eggs on the hi-tech gadget.

5 Paul Reilly was caught on film filling the drone with drug-filled packages Credit: Crown Office

But their plot unravelled when the £1,589 gizmo crashed at Perth nick — where Martin’s brother is caged — and cops watched the recording.

Prosecutor John Malpass told the city’s sheriff court the clip also revealed a house number, a motor parked outside and a third male.

He said: “There was footage of Reilly wearing gloves, filling the recovered Kinder Egg with white pills and cutting up the cannabis resin into square blocks.

“The number on the front door can clearly be seen. This address was associated with Martin and search warrants were issued.”

5 The drugs were recovered inside the prison grounds Credit: Crown Office

The court heard the crooks planned to fly almost £3,000 of narcotics to Martin’s brother Chris.

The crashed DJI Phantom drone was recovered by wardens in the prison yard. It was found beneath the Martin’s sibling’s cell window.

Mr Malpass told the court: “A prison officer was engaged in a routine patrol of the grounds.

“He heard a buzzing noise overhead but couldn’t see anything because of the darkness. He walked the perimeter wall and noticed a drone lying on the ground with a cellophane package lying next to it.

5 The dopey pair were trying to smuggle drugs into Perth Prison Credit: Michael Schofield - The Sun Glasgow

“Police seized the drone and package. There was a camera attached that had a micro SD card in it.

“It was examined and showed one video file held on it.

“In the footage it is clear the drone has been switched on to try it out, but it was recording without the knowledge of the suspects and shows three males.

“They were identified as Reilly, Martin and a third, as yet unidentified, male within a bedroom.”

The stash was prepared and attached at a home in Kirkcaldy.

The trial heard the cannabis had a prison value of £1,350. The 128 tabs were worth about £1,430 inside.

Mr Malpass went on: “Given the fact the drugs were found next to the crashed drone, and the method involved, officers had no doubt this was an attempt to introduce drugs into the prison.”

Reilly, from Cumbernauld, yesterday pleaded guilty to supplying drugs on September 22, 2017. He also admitted failing to turn up for a previous hearing.

5 They accidentally shot 18 minutes of film on the drone Credit: Crown Office

5 The pair could be seen trying to work the drone's remote Credit: Crown Office

Martin, of Kirkcaldy, had earlier been found guilty by jurors of supplying drugs to HMP Perth.

He was cleared of other charges including breaching civil aviation laws by flying a drone into a prison on September 22 and 25.

Sheriff Lindsay Foulis jailed Reilly for 33 months. Co-accused Martin was locked up for a year.

Reilly’s lawyer Gerry Considine said his client had battled drug addiction for many years which had led to previous criminal offending.

MOST READ IN SCOTTISH CRIME NEWS LATEST Highest Covid cases spike, Sturgeon resignation calls & Greenock fires linked 'LIVES AT RISK' Four Greenock fire attacks 'linked' as one man dies and woman in hospital TRAGEDY Tributes paid to 'well loved family man' who died in West Lothian hit and run Breaking LAW CHANGE Hate crime bill watered down as Humza Yousaf admits it could harm free speech MOTOR TORCHED Hunt for thug who drove 4x4 into Glasgow salon and torched it before fleeing PERV CAGED Edinburgh flasher who cut hole in jeans to expose himself to women is jailed

The brief said: “He accepts he assisted in packaging these drugs for onwards supply.”

Martin — another past offender — was mocked at an earlier hearing for his role in the bungled op.

Prosecutor Michael Sweeney said: “If there was an award for the movie with the most inept director, it would be won by the accused.”

Three days after the crash gaffe, a second identical device was flown into the prison.

Lags were seen using a pole and hook to grab the package from inside a third floor cell.

Jail staff found two mobile phones hidden in a tub of protein powder.

Lads on Ryanair flight cut up lines of white powder - and steward bringing them vodka doesn't bat an eyelid

We pay for your stories and videos! Do you have a story or video for The Scottish Sun? Email us at scoop@thesun.co.uk or call 0141 420 520