A drunk man set off a hijack alert on a Virgin Australia flight from Brisbane to Bali when he tried to break into the cockpit of the plane.

Those on the Virgin Australia flight had a scare when the drunk 28-year-old man, identified as Matt Christopher Lockley of Australia, started banging on the door of the cockpit and tried to get in about an hour before the flight was supposed to land. Airline officials later called the incident a "flight emergency" and not a hijacking, Reuters reports.

"There was a drunk passenger, intoxicated and aggressively behaved. He was trying to enter the cockpit, banging the door but he did not enter the cockpit," Heru Sudjatmiko, airport manager for Virgin Australia in Bali, told Indonesia's Metro TV.

Flight crew members restrained the Lockley and he was handcuffed on board. Once he was restrained, the pilot alerted Indonesian air traffic controllers about a possible hijacking. The flight landed about an hour later in Bali as planned, without further incident.

Right after the plane landed, Lockley was arrested for causing a disturbance on board. None of the 137 passengers or six crew member on board were harmed. After the plane landed, they were taken off the plane in Denpasar International Airport in Bali.

"The police are having difficulty digging up information on what he intended to do because he is still in an unstable condition," a police official at Bali airport said according to Reuters.

A flight attendant told police that Lockley, who was traveling alone, looked paranoid. He is being tested for alcohol and drugs in his system.

The incident caused Bali airport to be shut down for a few hours but the airport resumed normal operations after.