An Australian passenger mistook the cockpit door for the toilet on a Virgin Australia flight from Brisbane to the Indonesian holiday island of Bali, triggering Friday's hijack scare, police have said.

Matt Lockley told Bali police after his arrest he banged on what he believed was the toilet door before the Boeing 737-800 aircraft landed.

But Mr Lockley had actually banged on the cockpit door and the pilot, Neil Thomas Cooper, responded by alerting Indonesian traffic controllers of a possible hijacking.

Download the new Independent Premium app Sharing the full story, not just the headlines

Crew members on board Flight VA41 then seized the 28-year-old and handcuffed him.

"The flight was about to land and (Mr Lockley) was sleeping. The flight attendant woke him up and he went to the toilet. At the time, he thought the cockpit door was the toilet door," Heri Wiyanto, a Bali police spokesman said.

Initial reports had suggested Mr Lockely was inebriated at the time of his arrest after he was described as “drunk” by the local airport manager.

Police said Mr Lockley, who is being treated for a medical condition, had taken several painkillers, including four Panadol and two Voltaren pills before boarding the flight from Brisbane to Bali. He was taken to a Bali hospital and police said they will question him again "after his health has returned".

Virgin Australia said the 137 passengers and seven crew on board were never in any danger during the flight.

"We can confirm there was a disruptive passenger on board and the pilot notified authorities in advance of landing, as per standard operating procedures," said Virgin spokeswoman Jacqui Abbott.

Mr Lockley, who was travelling to visit his Indonesian wife, was shown on local television shortly after the flight surrounded by armed security and a mob of reporters at the airport. Copies of his identification cards were also shown to the media.