JERUSALEM — With a two-sentence statement supporting the Iraqi Kurds’ plan to hold a referendum on independence this Monday, Prime Minister Benjamin Netanyahu put Israel at odds with nearly every other major player in the Middle East.

Mr. Netanyahu, who endorsed not only the referendum but also the establishment of a Kurdish state, had ample strategic reason: A breakaway Kurdistan could prove valuable to Israel against Iran, which has oppressed its own Kurdish population.

Live Updates: Kurdish referendum begins, follow for all the developments

But given the interwoven history and shared emotion underlying his statement, present-day geopolitics can seem almost beside the point.

The Kurds and the Jews, it turns out, go way back.

Open gallery view Tzur Sagi of the Israeli army, with Mullah Mustafa Barzani in Iraqi Kurdistan, 1966. Credit: Handout via The New York Times

Back past the Babylonian Captivity, in fact: The first Jews in Kurdistan, tradition holds, were among the last tribes of Israel, taken from their land in the eighth century B.C. They liked it there so much that when Cyrus the Great of Persia conquered the Babylonians and let the Jews go back home, many chose instead to stick around.

Sixteen centuries later, Saladin, a Kurd, treated the Jews humanely after he conquered Jerusalem, and notably hired a Jewish doctor, Maimonides, as his physician.

In the modern era, Kurdish Jews departed en masse for Israel when the Jewish state was created in 1948, leaving Kurdish civil society so bereft that some recall its leaders still lamenting the Jewish exodus decades later.

Ties between the two have only grown warmer and more vital since the 1960s, as Israel and the Kurds — both minorities in an inhospitable region and ever in need of international allies — have repeatedly come to each other’s aid. The Kurds have long patterned their lobbying efforts in Washington on those of Israel’s supporters.

And while Kurdish leaders have not publicly embraced Israel in the run-up to the referendum, for fear of antagonizing the Arab world, the Israeli flag can routinely be seen at Kurdish rallies in Erbil and across Europe.

Open gallery view “I became a patriotic Kurd,” says Mr. Sagi, now 83 and a retired brigadier general, who worked as an Israeli military adviser to Kurdish fighter. Credit: Dan Balilty for The New York Times

The Kurds in turn have friends and supporters all across Israel, including some 200,000 Kurdish Jews. But 83-year-old Tzuri Sagi, a retired brigadier general, has more reason than most Israelis to root for Kurdish independence.

In the winter of 1966, Mr. Sagi’s commanders sent him on a secret mission, via Israel’s then-ally, Iran, to aid Mullah Mustafa Barzani and his pesh merga rebels in Iraqi Kurdistan. Six Iraqi army brigades were standing by to overwhelm the Kurds when the snow melted. Mr. Sagi, a lieutenant colonel, drew up defenses for Barzani’s lightly armed fighters. When those collapsed, Mr. Sagi advised the Kurds to allow the best of the Iraqi brigades to break out — right into an ambush.

The 5,000-man Iraqi brigade was wiped out, and the battle, on Mount Handrin, became a landmark in Kurdish history. Mr. Sagi recalls Iraqi officers driving up in two jeeps waving white flags.

“They said to the Kurds, ‘What do you want?’” he recalled.

Over the years, Israeli doctors set up a field hospital for the Kurds, its soldiers trained the pesh merga fighters and the Mossad helped arm them.

After Israel’s defeat of its Arab neighbors in 1967 and the Baathist coup in Iraq a year later, Iraq became inhospitable to its dwindling Jewish population. Then it was the Barzanis’ turn to help.

Open gallery view Iraqi Kurds at a rally in Erbil supporting the independence referendum, to be held this Monday. Most countries in the region oppose it. Credit: Ivor Prickett for The New York Times

After nine Jews were hanged in Baghdad’s Tahrir Square in 1969, Iraqi Jews were desperate to flee. The Kurds helped some 1,000 of them escape, over land to Iran and then by plane to Israel.

“They were going on donkeys, through the mountains,” said Ofra Bengio, a pre-eminent historian of the Kurds and professor emerita at Tel Aviv University’s Moshe Dayan Center.

One of the escapees was Zamir Shemtov, 63, now a dentist in Herzliya, who was a teenager in 1970 when his parents and extended family made their first attempt to flee Iraq. Arrested and locked up for a month, they tried again, but this time they were blackmailed, robbed, caught by the army and sent back to Baghdad, where his father was brutally interrogated, Mr. Shemtov said. Released two months later, they tried to get out a third time. This time, a Kurdish taxi driver ushered them to a safe meeting point where a young uniformed Kurdish fighter loaded them in his jeep and ferried them across the border into Iran.

Mr. Shemtov said that near the end of the drive, his father offered the fighter his gold watch in gratitude.

“The young man answered, ‘I am Masoud Barzani, son of Mullah Barzani, and if Mullah would hear that I took a watch, he would hang me!’” Mr. Shemtov recalled. “‘Instead, all I ask as thanks is that you remember us well in the future.’”

Open gallery view A young Kurdish fighter helped Zamir Shemtov, now 63, and his family escape from Iraq in 1970. Credit: Andrew Testa for The New York Times

A few years later, the young Masoud Barzani succeeded his father as head of the Kurdistan Democratic Party. Since 2005, he has been president of Iraqi Kurdistan.

Mr. Sagi, who returned to aid the pesh merga against Iraq in 1974, said he traveled around Kurdistan quite a bit in those years, posing as a British journalist despite what can generously be called a tenuous command of English. “Sometimes I would tease the Kurds, and say negative things about Israel,” he said. “It always made them angry. They’d say that Israelis and the Jews are the best in the region.”

Mr. Sagi said such sentiments stirred a reciprocal feeling in him: “I became a patriotic Kurd.”

He was not alone: The story goes that Israeli soldiers and Mossad agents wept when the shah of Iran double-crossed the Kurds by signing the Algiers Accord with Iraq, a 1975 resolution of border disputes that ended the Kurdish rebellion and forced the pesh merga to retreat into Iran.

Today, as the Kurds take a step they hope will realize a national dream of an independent state, they have been increasingly isolated.

Iraqis oppose the Kurdish referendum because they want to keep their country intact. Iran and Turkey fear it will escalate separatist ambitions among their Kurdish minorities. And a coalition of powers, along with the United Nations Security Council, fear the referendum could disrupt military efforts to defeat the Islamic State.

But Mr. Netanyahu had little to lose from his endorsement of the referendum, experts say.

Open gallery view Fleeing Iraqi Jews arrive at the Israeli consulate in Tehran in 1970. At the time, Iran was an Israeli ally and Iraq was becoming inhospitable to Jews Credit: Andrew Testa for The New York Times

“Israel is desperate for friends in the region, the Kurds generally want to be friends, and they don’t care about Palestine,” said Kenneth M. Pollack, a former C.I.A. analyst and National Security Council official who visits Kurdistan frequently.

Moreover, Israel stands to gain a potentially valuable ally in its struggle with Iran, he said.

“Iraqi and Iranian Kurds have deep ties,” he said. “And to create trouble for Iran, one way is to encourage independence for Iranian Kurds. The Iranians are terrified and furious about exactly that: that the Israelis are doing it, and that an independent Kurdistan will be a base for Israeli operations against Iran, via Iran’s Kurdish population.”

While United States policy is to try to preserve Iraq as one entity, the Israelis are more practical, said Peter W. Galbraith, a former diplomat with extensive experience in Kurdistan: “Why lose all of Iraq, when you could save part of it?”

At bottom, though, analysts and ordinary Israelis alike seem invariably to land on moral and emotional arguments for supporting the Kurds, often sounding much like Mr. Shemtov, the Iraqi-born dentist.

“Our two nations have fought against all odds when those surrounding us wanted to destroy us,” he said. “From my perspective, if there is a lone sign of light in Islam, it is the Kurds.”

He says he owes his life to them.

“They saved us,” he said. “My dream now is that they declare independence, and I come to Erbil and salute while their anthem plays.”