The captain of an Israel-bound Flydubai flight has revealed how he opened the cockpit door to allow passengers and crew to help regain control of the plane after he was attacked by his co-pilot.

Indian pilot Smit Machchhar said he made the decision while injured and under attack after realising the aircraft was rapidly losing altitude.

Speaking to Indian Prime Minister Narendra Modi during a video call, Machchhar said he made one final effort to open the cockpit door from inside.

“I was lying on the floor injured but I told myself to go for one last push to open the door from inside,” he said.

He said other passengers then entered the cockpit and helped control the situation, even as he fought to stay safe.

Machchhar said he knew he had to act because the lives of everyone on board were at risk.

The pilot had been attacked by another crew member while the aircraft was flying from Dubai to Tel Aviv, forcing the plane to divert to Saudi Arabia.

The aircraft reportedly lost more than 17,000 feet in altitude about two hours into the journey on Wednesday before passengers and crew managed to overpower the attacker and regain control.

The plane later landed safely in Tabuk, north-western Saudi Arabia, where Machchhar was taken to hospital for treatment.

Modi praised the captain, saying his courage, patience and quick decision-making helped save many lives.

Israeli Prime Minister Benjamin Netanyahu also hailed Machchhar as a “true hero” following the incident.