Patrick Grigor (L) and David Sneath had been on a work night out
Two drunk men on a work night out sparked a terror alert after they broke into an airport and tampered with the controls in the cockpit of a plane.
Police on high alert arrived to find one of the men wearing a pink cowboy hat, straddling a plane and covered in foam from a fire extinguisher.
Pizza Hut workers David Sneath, 25, and Patrick Grigor, 24, climbed a fence to get into Dundee Airport, a court heard.
The pair were given a deferred sentence for one year to be on good behaviour.
Sheriff George Way also told them to "voluntarily" make compensation payments to Tayside Aviation, who owned the aircraft.
Dundee Sheriff Court heard the men had been in a nightclub before walking to the airport, climbing a security fence and entering a hangar.
They discharged a fire extinguisher over five planes, causing £8,400 worth of damage and grounding them until safety checks were carried out.
An airport security officer found the pair in the controlled area on 20 May 2009, looking into the cockpit of a plane with one of them covered from head to toe in white powder.
They admitted entering the restricted zone and "maliciously" discharging a fire extinguisher over five aircraft, covering them in a noxious substance and rendering them unsafe to operate.
They also pleaded guilty to entering two other aircraft without authority and interfering with the controls.
A defence agent for Grigor said: "When police were first called, they were concerned it might be a terror incident.
"But when they arrived Mr Grigor was seen wearing a pink cowboy hat, straddling an airplane with a fire extinguisher and covered in foam. They soon realised what was going on."
Solicitor John Boyle, acting for Sneath, said: "He was considerably under the influence of alcohol. He can't remember how he got there."
Speaking after his court appearance, Grigor said: "There was no malice intended. We had both been on a work night out and after we left the Students' Union at 2.30am, we must have gone for a drunken walk, perhaps looking for a party.
"We have no real recollection of how we got to the airport, how we got in, or what really happened.
"At first the police mentioned something about terrorism. The day after, when we got interviewed and we had sobered up, they realised it was just a couple of drunken idiots."