The Australian Transport Safety Bureau has launched an investigation into an engine failure that caused an AirAsia X jet to “shake like a washing machine” for two hours.

The Airbus A330, with 359 passengers on board, had taken off from Perth for a flight to Kuala Lumpur. Seventy-five minutes into the journey, when flight D7 237 was close to Carnarvon on the Western Australia coast, passengers heard a loud bang.

One of the two Rolls-Royce engines had failed, and the crew decided to return to Perth - with the aircraft shaking for the entire journey.

One passenger, Sophie Nicolas, told ABC News: "I could tell by the cabin crew's reaction that it was really bad.

"I was crying a lot, a lot of people were crying, trying to call their mums and stuff but we couldn't really do anything just wait and trust the captain."

Another passenger, Damien Stevens, told CNN: “It shook for the whole ride back, close on two hours.” He said that the pilot asked passengers to pray - twice - and that they were instructed to hold the brace position during landing. The pilot then shook hands with every passenger after landing safely.

In a statement, the airline said: “The safety of our guests and crew is of the utmost importance to us. We are currently conducting an investigation into the cause of the incident together with our engine manufacturer Rolls-Royce.”

The AirAsia X Group operates exclusively Airbus A330-300 aircraft with an average age of less than five years.

The Australian Transport Safety Bureau said: “As a result of an in‑flight engine fault, the aircraft was subjected to moderate airframe vibration. The flight crew elected to return to Perth.”

The bureau will interview the crew, investigate the engine damage and analyse data from the flight data and cockpit voice recorders.

Two weeks ago a China Eastern Airbus A330 fitted with the same type of Rolls-Royce engines made an emergency landing after a gaping hole was ripped in an engine casing just after take-off from Sydney.