At 05:40, the plane - which had briefly entered Jordanian airspace - looped back into Saudi Arabia, where it later started its manual descent for landing.
Less than an hour later, the plane returned to squawk 7700.
Initial local media reports cited Israeli officials as saying a fight had broken out between two pilots.
But, speaking on Wednesday following the incident, Netanyahu confirmed later reports that one pilot had stabbed the other before "apparently trying to crash" the plane.
He said an Israeli passenger told him "the plane went into a spin and began to descend" before the passenger and a crew member broke into the cockpit and overpowered the "pilot who had carried out the stabbing".
The plane was diverted to Tabuk Airport in northwestern Saudi Arabia and touched down at 06:58, according to location data.
The stabbed pilot, who is in a stable condition according to the Indian embassy in Saudi Arabia, was later identified as Indian national Capt Smit Machchhar.
Paying tribute to Machchhar, Netanyahu hailed him as a "true hero" and said "he saved the lives of 174 people, including Israeli citizens and other nationals".
Passenger Yaniv Hayun, who was later greeted and described as a hero by Netanyahu, said in a video released by the prime minister's office that he and others were trying to open the cockpit door, but the stabbed pilot was very close to it.
Before the pilot collapsed, the injured man managed to open the door, Hayun said.
He said that inside, the attacker was "trying to destroy the instruments in order to disable the plane".
Hayun then described putting the attacker in a chokehold and pulling him outside of the cockpit before other passengers helped to pin him down.
He added that he "pulled the controls" of the plane, explaining to Netanyahu that he watches Canadian documentary series Air Crash Investigation. "The plane started to level out, a bit more, and then [another] pilot told me he was taking control from there."
Zvika Meness, another passenger, told Israeli public broadcaster Kan News that he and other passengers tied the attacker up "with his own zip ties and with the multimedia headphones".
"There are children and families here who have been through a very severe, highly traumatic event," he added.
Yasmin Abukasis told Reuters that her daughter who was on the flight said a man holding a knife had forced one of the pilots onto the floor, with blood everywhere.
"The plane start to lose control. So all the people, they scream, they think they are going," Abukasis told AP news agency.
Speaking from Ben Gurion Airport, she said her daughter phoned her to say she heard screaming as a pilot called for help, adding that two other pilots took control of the plane as other passengers ran towards a man who had a knife.
Almog Itali, who was also on board the flight, told media that one of the pilots who landed the aircraft was British. The other pilot was European, Itali said, although he did not provide a specific nationality.
One female passenger described the "very stressful" moment people realised the plane was descending. "We understood the pilots lost control," she told Israeli newspaper Israel Hayom.
"There are people here with shirts covered in blood," she said, adding: "Now we are fine and want to return home."
Shortly after the incident, the Israeli and Saudi Arabian air forces dispatched fighter jets, while Netanyahu held urgent consultations.
Speaking later on Wednesday, Netanyahu called the situation a "a very serious security incident".
He added Israeli security forces are "maintaining close contact with the relevant authorities to ensure the continued safety of the passengers".
"I salute these heroes who demonstrated extraordinary resourcefulness and courage," he added. "They saved many lives and prevented a major disaster."
Flydubai meanwhile said "an altercation occurred in the flight deck" and the flight was "successfully secured by on-duty Flydubai crew travelling on the flight, who diverted and landed the aircraft safely at Tabuk airport".
The airline said two replacement aircraft were sent to Tabuk to relieve the passengers and crew, and the incident had no impact on other scheduled operations.
The repatriation flight carrying passengers left Tabuk at 17:40 local time (14:40 GMT) and arrived in Tel Aviv at around 18:40 local time (15:40 GMT).
The spokesperson added: "Our immediate priority is to ensure the ongoing safety, health, and wellbeing of all passengers and crew members involved in this incident and support the official investigation."