The 25-year-old man, a Sri Lankan national, was tied up with seatbelts and the flight diverted back to Melbourne following the incident shortly after takeoff from Tullamarine Airport late on Wednesday.
Former AFL player Andrew Leoncelli, who was a passenger on the flight, said the man screamed, "I've got a bomb and I'm going to f***ing blow the plane up," before flight attendants and other passengers tackled and restrained him.
Arif Chaudhery, another passenger on board MH128, told Reuters that about 30 minutes into the flight a male passenger attacked a female member of the cabin crew who screamed for help.
"Some passengers and crew grabbed the man and tackled him to the floor," Mr Chaudhery said, adding that seat belts were used to tie the man's hands.
"We believe that the actions of the passengers and crew were heroic," Victoria Police Superintendent Tony Langdon was quoted as saying. "They managed to calm the situation, allow the aircraft to return safely and we can't commend them highly enough."
Mr Langdon said the incident was not terror-related and the man was known to police due to his history of mental illness.
He said the man was carrying an electronic device that police quickly realised was not a bomb. "He had a piece of equipment which, for all intents and purposes is something that everybody would be carrying around on a daily basis."
Armed police boarded the plane when it landed back in Melbourne, taking the man, who bought a plane ticket hours after being released from psychiatric care, into custody.
The man is due to appear in court on Thursday on charges relating to making threats, false statements and endangering the safety of an aircraft.
About three minutes later the same male voice can be heard saying the passenger "claiming to have an explosive device, tried to enter the cockpit, (and) has been overpowered by passengers."
"However we'd like to land and have the device checked," the voice said.
Malaysia Airlines in a statement said the aircraft turned back "after the operating Captain was alerted by a cabin crew of a passenger attempting to enter the cockpit".
"Malaysia Airlines would like to stress that at no point was the aircraft 'hijacked'," it said.
"MH128 safely landed in Melbourne airport at 11.41 pm (local time). Following the incident on MH128, the disruptive passenger has been apprehended by airport security. Malaysia Airlines together with the Australian authorities will be investigating the incident," it said.
Malaysia Airlines has suffered two major disasters in recent years. In 2014, Flight MH370 with 239 people on board went missing on its way from Kuala Lumpur to Beijing.
The Boeing 777 plane has yet to be found and its location is one of the world's greatest aviation mysteries. The deep-sea search for the missing plane was called off in January.
(With inputs from Reuters and PTI)