Members of an Israeli family reunite at Ben Gurion International Airport after the Israeli raid on a hijacked Air France plane that had been flown to Entebbe, Uganda, in 1976. (Reuters)

It was an audacious rescue mission, one that has taken on mythical proportions and is the subject of books and movies.

On June 27, 1976, Palestinian and German terrorists hijacked an Air France flight making its way from Tel Aviv to Paris. The 248 passengers from several nations and a 12-member French crew were taken to the airport in Entebbe, Uganda.

With the help of Idi Amin Dada, the East African country’s ruthless dictator, they were held in a rundown terminal until Israeli commandos raided the airport one night.

On Monday, Israeli Prime Minister Benjamin Netanyahu will participate in a ceremony at Entebbe to mark the 40th anniversary of the rescue mission. He will become the first Israeli prime minister to visit the country since the crisis and the first in ­sub-Saharan Africa in 30 years.

The July 4, 1976, raid at Entebbe is remembered by many Israelis as one of the country’s greatest military feats, and it changed the way governments worldwide confront terrorism.

Chief of Staff Lt. Gen. Mordechai Gur gestures at a news conference in Tel Aviv on July 8, 1976, during which he gave details of the Entebbe airport raid. A map of the airport is shown behind Gur. (Nash/AP)

Netanyahu’s brother Lt. Col. Yonatan “Yoni” Netanyahu, who led the assault team, was the only Israeli soldier killed there. Initially called Operation Thunderbolt, the mission was later renamed Operation Yonatan in his honor.

The operation inspired Netanyahu’s political career: After his brother died, he organized a conference on international terrorism in his honor. Israel’s ambassador to the United States at the time, Moshe Arens, was so impressed by the younger Netanyahu that he asked him to become involved with explaining Israel’s case to the world, known as “hasbara” in Hebrew.

“And that is how I got into politics,” Netanyahu recently said in a live Facebook video chat.

Over the past 40 years, soldiers who took part in the operation have debated its near-failures, luck and successes, and military historians have called into question some of its myths, including Yonatan Netanyahu’s legendary role.

“It was an impossible situation for the Israeli government,” said British historian Saul David, whose book about the raid, “Operation Thunderbolt,” was published last year. “But then suddenly, the world woke up to the news that the Israelis had succeeded in this impossible situation.”

“The chances of this succeeding were very low, and it came very close to being a disaster,” he said. “In my story, Yoni is not the hero.”

Forty years ago, Israeli special forces carried out a daring rescue mission in Entebbe, Uganda. Days before, members of the Popular Front for the Liberation of Palestine and the German Revolutionary Cells hijacked an Air France plane flying from Tel Aviv to Paris. The terrorists held the hostages at the Entebbe airport before the Israeli troops stormed the terminal. (The Washington Post)

The story started when members of Popular Front for the Liberation of Palestine and the German Revolutionary Cells, a spinoff of the Baader-Meinhof Gang, a radical left-wing group, commandeered the plane.

Within days of diverting the plane to Africa, the captors moved the Israeli passengers — about 100 people — to a smaller room. It was especially frightening for the older Israelis, many of whom had painful memories of World War II when the Nazis sent Europe’s Jews first to the ghettos and then to death camps. Families of those being held begged the Israeli government to save their loved ones.

The hijackers demanded the release of dozens of Palestinian and pro-Palestinian prisoners, many in prison for murder.

To some officials, a military operation so far away seemed impossible. But others said that giving in to the terrorists’ demands would make Israel appear weak and bring more attacks.

On the fifth day, after most of the non-Israeli hostages were released, then-Defense Minister Shimon Peres and his generals decided to formulate a plan.

The question was how to transport some 200 soldiers in secrecy 2,500 miles to the East African country? Would it be possible to fly C-130 Hercules cargo planes loaded with soldiers, equipment, vehicles and medical teams for more than seven hours? And how would they make it back to Israel with the hostages?

“It was a sophisticated and complex operation that we planned in less than 24 hours and carried out in less than 48 hours,” said Amnon Biran, who at the time was a lieutenant colonel for the infantry and paratroopers command.

Biran tells the story via a slide show of old newspaper clippings, grainy news reels and video footage. “I thought our chances were about 60/40 and we would come back with at least 40 coffins,” he said.

The commandos faced even more obstacles as the first Hercules set off, including outdated maps of the terminal building and conflicting intelligence about the hostages’ exact location. Photos of the terminal, taken in secrecy by Israel’s Mossad, were received only at the last minute.

The plan was to land the planes in darkness in Entebbe, and then to send a small team into the terminal to kill the terrorists. Other soldiers were tasked with securing the perimeters, neutralizing the control tower and commandeering the newer terminal. Later, they were ordered to destroy Amin’s small fleet of MiG fighter jets.

A Boeing would circle above giving commands from the air, as a medical team waited in nearby Nairobi.

The Israelis — dressed as Ugandan soldiers and driving a black Mercedes decorated like one that would carry Amin or a senior Ugandan commander — were supposed to bypass the Ugandan military guards at the entrance to the old terminal.

But a Ugandan sentry called out “advance!” to the car, and Netanyahu was convinced he was suspicious and shot him. The shot, however, did not kill the Ugandan outright, and a follow-up team took him out with a round of gunfire, the sound of which alerted the terrorists that something was afoot.

Less than a minute later, as the first group stormed the terminal, Netanyahu was hit by sniper fire. Most who were there say it came from Ugandan troops inside the control tower.

Overall, the operation saved 101 hostages. Three of the hostages, however, were killed in crossfire at the airport.

Furious about Israel’s actions on his territory, Amin ordered the death of Dora Bloch, an elderly passenger with dual Israeli and British citizenship who had been taken to a Ugandan hospital a day earlier.

Forty years later, debates about Entebbe continue. But Omer Bar-Lev, who led one of the assault teams, said that “every small detail can be argued about today.”

“We know he shot the guard, but I don’t think it ruined the surprise. Today, we know that the terrorists heard the shots and thought we were Ugandan soldiers. They told the hostages to lie down — that actually helped us,” said Bar-Lev, who today is a member of the Knesset.

Still, he has some reservations.

“The plans kept changing, and there were a lot of unknowns,” he said.

Bar-Lev decided to warn his father, the minister for Industry and Trade at the time, and the Israeli cabinet that the Entebbe plan was “far from perfect.”

“It was like Swiss cheese, there were so many holes in it,” Bar-Lev said. “The pressure on me was so big, I was confused, so I took a car and started driving to my parent’s home.”

On the way, however, the car broke down and he had to turn back to base. He never warned his father, and the next day the cabinet gave final approval for the mission.

The rest, Bar-Lev said, is history.