An investigation is underway after a passenger plane started violently shaking in mid-air. A suspected engine failure is to blame.

Passengers on the Air Asia X flight from western Australia to Malaysia report it was like being inside a washing machine, with violent vibrations shaking the cabin for nearly two hours.

The plane safely returned to Perth after the continuous shaking began, reports CBS News correspondent Kris Van Cleave.

Video from inside Air-Asia X Flight D7237 shows the Airbus A330 rattling through the sky, shaking the nerves of the 359 people on board. One passenger posted on Instagram, "I thought I might die."

I thought I might die..... Today was my beginning the trip,but I backed to the Perth due to technical issue.... Anyway I still arrive!!! Thank you God!!! #airasia #perth #flight #tokualalumpur A post shared by saya mae (@maesaya) on Jun 24, 2017 at 9:37pm PDT

Passengers say the pilot twice came over the intercom telling them to "pray."

"Our survival depends on your cooperating," the pilot announced. "Hopefully everything will turn out for the best."

The flight was on its way to Kuala Lumpur from western Australia, but was forced to turn around after what the Australian Transport Safety Bureau called an "in-flight" engine fault.

"Suddenly we heard, like, a bang noise and everything starts shaking," one passenger said afterwards, "and then the captain said we have to go back to Perth."

Adding to the crisis: The view from the window showed the plane's engine shaking uncontrollably.

"it was just like a small explosion almost from the left wing, and the plane just started shuddering," said passenger Sophie Nicolas.

Passengers were told to brace for possible impact on landing, but they arrived safely back in Perth.

"Thank God," one passenger said. "The pilot was really good and he's done a really, really great job, and I'm really thankful for that."

The airliner is being checked over by engineers and remains grounded. Passengers took a flight out later that day to Malaysia, accompanied by the same pilot.

This is the third issue with type of engine on A330 since May.

On June 12 a China Eastern Airlines plane heading to Shanghai returned safely to Sydney after an in-flight problem left a gaping hole in the engine casing.