Amir Tibon is a diplomatic correspondent with Walla News.

Ehud Barak hadn’t given a speech in months, and speculation was rife about what he was going to say when he took the stage at a prestigious policy conference in Herzliya, an affluent suburb of Tel Aviv, two weeks ago. Barak was one of Israel’s leading political figures for two decades, having served as the country's prime minister in the late 1990s and later as defense minister under Benjamin Netanyahu from 2009 to 2013. Was he about to announce a political comeback?

It turned out that Barak, a former special ops commando officer, had one last mission in mind: To take out his former boss and partner.


In his speech, Barak accused Netanyahu of cowardice, opportunism and fear-mongering. He warned that Israel's current government, arguably the most right wing in its history, was showing “signs of fascism,” and that if Netanyahu wasn’t stopped, Israel was on course to become an apartheid state. “The entire Zionist project is in grave danger,” he proclaimed. And the main source of that danger wasn't Israel’s external enemies, but rather its own democratically elected leader.

Barak hasn’t let up since. “Netanyahu,” he said in a televised interview broadcast a day after his angry speech, “has gone off the rails. He needs to go.”

But Netanyahu doesn’t seem to be going anywhere; instead it is Israel’s former generals, like Barak, who are being marginalized while the longest-running prime minister in the Jewish state’s history consolidates his power. Barak wasn't speaking only for himself when he attacked Netanyahu in such strong language. Over the past few months, the top news story in Israel has been the right-wing prime minister's tectonic power struggle with Israel's security establishment. One after the other, Israel's top security chiefs and military leaders have criticized Netanyahu's flagship policies and warned about the direction in which he is leading the country, typically over his refusal to engage in talks with the Palestinians and his push for military action against Iran.

Last month, in a move characterized by some Israeli pundits as an act of retaliation against the rebellious security establishment, Netanyahu announced he was appointing Avigdor Lieberman to be the country’s next defense minister. A hawkish civilian politician who was once Netanyahu's personal chief of staff, Lieberman would be the most inexperienced defense minister in Israel’s history. Lieberman supported an attack on Iran in the years 2009-2012, when the country's top generals were against it, and has also threatened in the past that Israel could bomb Egypt, despite the fact that the countries have had a successful peace treaty for decades. He is also famous for his blistering criticism of the Israeli military's conduct, always demanding harsher methods—some bordering on illegal, and some crossing that border—against the Palestinians. His appointment is likely to weaken Israel’s security establishment and make it harder for the country’s top generals and spymasters to challenge the government’s policies.

As difficult as Netanyahu has been for Obama, he’s sure to be even tougher with the next U.S. president.

Netanyahu has recently entered his 10th cumulative year in power, and he’s likely to be around when the next president of the United States begins his or her term in office. The changes he’s brought are going to pose growing challenges for the U.S. as it navigates the treacherous waters of Middle East politics. As difficult a customer as Netanyahu has been for Barack Obama, he’s sure to be an even tougher one for the next U.S. president—in large part because of his successful purging of the Israeli national-security establishment that was keeping him in check.

President Obama listens to Prime Minister Netanyahu during a March 2014 visit at the White House. | Getty Images

What this means is that disagreements between Israel and the U.S. on the Iranian issue could resurface very quickly, despite the fact that a nuclear deal with Iran was signed less than a year ago, and also that on the Palestinian front, a new escalation is much more likely than any progress toward peace. Only last October, Netanyahu declared that Israel will “forever live by the sword.”

The Jewish state's top generals, spymasters and intelligence chiefs have been the fiercest and most outspoken critics of Netanyahu’s policies over the years; unlike in most Western democracies, where the military is usually considered more hawkish than the civilian leadership, in Netanyahu's Israel, it's usually been the other way around. Out of the 17 most senior security and intelligence chiefs who have worked directly with Netanyahu during his time in office, no fewer than 13 have strongly criticized his flagship policies or the direction in which he is leading the country (of the four that haven't, two are currently still in office).

Of the 17 most-senior security & intel chiefs who have worked with Netanyahu, at least 13 have strongly criticized his policies.

Some of the renegades once counted themselves close friends and partners of Netanyahu, and their breaks with their boss have been especially striking. One of these is Tamir Pardo, the former head of Mossad, Israel’s CIA. Pardo had participated in the famous Entebbe hostage rescue operation in which Netanyahu's revered older brother, Yoni, was killed in 1976; and Pardo was one of the last people to speak to the mortally wounded Yoni—who in death became a national hero and icon, helping to give rise to Bibi’s political career. Pardo was also a regular participant in the annual memorial service organized by the Netanyahu family. So the prime minister had reason to think, when he picked Pardo to replace the balky and difficult Meir Dagan as head of Mossad in 2010, that he’d at last found someone who was a loyalist and as much of a hawk on Iran as he.

But it was not to be. Time after time, when Netanyahu raised the option of bombing Iran’s nuclear facilities within Israel’s most secretive security forums, Pardo, like the other generals, vehemently opposed it. At one of his rare public appearances in 2011, when the Iranian program was in full flower, Pardo enraged Netanyahu by declaring that "Iran is not an existential threat to Israel. People are using the phrase 'existential threat' with too much liberty." Pardo didn't specify the “people” he was referring to, but with Netanyahu regularly invoking the Holocaust into his warnings about Iran, it wasn't difficult to understand.

Pardo retired earlier this year. In his last briefing as head of Mossad to members of the Knesset (Israel’s parliament), he talked about the importance of strengthening the Palestinian Authority and trying to solve the conflict with the Palestinians. “He couldn’t be more clear about it,” says one Knesset member who attended the top-secret briefing.

Yaakov Peri, a former head of the Shin Bet—Israel’s internal intelligence agency—who has also served as a cabinet member in one of Netanyahu’s governments, told me recently that "some people like to say the security establishment is in fact leading the opposition in this country. I think that's an exaggeration, but there's no doubt that on two issues—Iran and Palestine—the security establishment's professional analysis has consistently contradicted Netanyahu’s policies and statements.”

***

The roots of the disagreements between Netanyahu and the security establishment can be found in the prime minister’s dismal and pessimistic view of the world. Netanyahu sees military might as the only possible tool to keep his country safe. Most of Israel's security chiefs, on the other hand, envision Israel as a country that derives its strength from arms, but also seeks benefits from diplomacy and peacemaking, when possible. As Ehud Barak explained in his speech, “If you put in one room all the living former heads of the Mossad, the Shin Bet, and the Israel Defense Forces, more than 90 percent of them would say that it's simpler to protect Israel from a border that assures our security interests next to a Palestinian state, than to protect a ‘greater Israel’ with millions of Palestinians living under its control.”

The roots of the disagreements between Netanyahu and the security establishment can be found in his pessimistic view of the world.

Lt. General (ret.) Benny Gantz, who led the Israeli military from 2011-2015, recently made a similar point in a public speech: “We might have to continue living on our sword, but we have an obligation to check out other options as well, so we can tell our children that at least we tried.” The overwhelming majority of Israel's current and former security chiefs would sign on to this statement without hesitation. However, when I asked Netanyahu about it a few weeks ago, he replied that any discussion of peace initiatives at the moment is detached from reality.

By placing the hawkish Lieberman in the Defense Ministry, Netanyahu has seriously undercut the security establishment, the most important moderating force within Israel's power structure. Lieberman's predecessor, Lt. General (ret.) Moshe Ya'alon, was also affiliated with the right wing in Israel (he is still a registered member of the Likud party), but as a former general himself, he encouraged those serving under him to speak their minds freely and openly, even if their analysis contradicted that of the elected government. In the months leading to his removal from the Defense Ministry, Ya'alon gave backing to the IDF senior command on a number of occasions in which the generals clashed with other cabinet members from the right wing, mainly over the question of how much force Israel should use in retaliation to Palestinian terror attacks. Lieberman, who was still in opposition in parliament during that period, took the side of the most extremist ministers in the government, advocating policies that, if implemented, would highly increase the likelihood of war.

Now the next U.S. administration will find itself facing a new balance of power in Israel, between the most right-wing government in decades and the traditionally more moderate security establishment—one in which the extremists, at least for the moment, have triumphed.

Today, my colleagues and I are fighting the most important war of our lives—the battle for Israel's future.”

Over the past few months, as the recent tensions between Netanyahu and the security establishment were simmering, I spoke to dozens of current and former senior Israeli officials who have participated in this power struggle between Israel's most successful politician and its most popular national institutions. I asked them to help me tell the history of this battle, which spans over two decades, and also to draw out the consequences it could have for the Jewish state in the future. Almost everyone I talked to, whether it was people close to Netanyahu or people who vehemently oppose him, agreed that the prime minister's skirmishes with his top generals have had a profound effect on Israel—and that Netanyahu has succeeded in weakening his opponents.

“I fought in five different wars as a soldier and an officer,” Major General (ret.) Amnon Reshef, one of Netanyahu's strongest critics, told me recently. “Today, my colleagues and I are fighting the most important war of our lives—the battle for Israel's future.”

***

To understand what’s happened, it’s best to go back to the beginning of this internal war inside Israel, which began on the night of May 29, 1996, when Benjamin Netanyahu won an election in Israel for the first time.

Benjamin Netanyahu speaks during a Likud rally in Tel Aviv; May 19, 1996. | AP Photos

On that night, watching the first exit polls with his wife, Sara, Netanyahu was convinced he was going to lose. The election was held only six months after the murder of the previous prime minister, Yitzhak Rabin, by a right-wing extremist. Netanyahu, who was leader of the opposition at the time, participated in demonstrations against Rabin's attempts to make peace with the Palestinians, which featured pictures of Rabin dressed up as a Nazi officer. Most pundits assumed that Israeli voters would punish Netanyahu for "turning a blind eye to the wild incitement," of an assassin, a line used by his opponents, and the last opinion polls conducted before Election Day seemed to reinforce that assessment.

But in the last 24 hours of the campaign, something changed. Netanyahu’s “coalition of the ascendant”—consisting of Israel's ultra-orthodox, national-religious, settlers and immigrant populations—took him across the finish line, to the narrowest election victory in the history of the Jewish state.

It was a huge upset that sent shock waves through the entire country—and nowhere were they felt more strongly than inside the Israeli security establishment. Many of the country's top generals and spymasters at the time were considered personally close to Rabin—himself a decorated former general, who led the Israeli military to its greatest victory ever in the 1967 war. His murder was deeply traumatic for these men, and the fact that Netanyahu, who was accused of pumping up the public case against him, was now going to sit in Rabin's chair was even more difficult to stomach.

The hard feelings were mutual. “Bibi thought the generals were all ‘Rabin’s men,’” says a former senior adviser to the prime minister. “He didn't trust them.”

Netanyahu had grown up in a hard-line, nationalist home—his father was a history professor who preached against any form of compromise between Israel and its Arab neighbors. The top ranks of the military, by contrast, were consisted mostly of men who grew up in the strongholds of the left-leaning Israeli Labor Party. “For Netanyahu, they represented the founding Israeli elite, that his father—and many of his voters—simply despised," says the former senior adviser.

This was especially true of Lt. General Amnon Lipkin-Shahak, then the military's chief of staff, and one of the most popular men in Israel at the time. Tall and handsome, with green eyes and a résumé full of battlefield heroics, Lipkin-Shahak was considered by many as Rabin's natural heir. Both were born to famous Zionist families in Jerusalem, both were affiliated with the IDF's Paratroopers Brigade, and both believed that Israel was strong enough militarily to pursue peace with its neighbors. "They had a father-and-son-like relationship for years," says Colonel (res.) Benny Lavie, who was Lipkin-Shahak's closest aide at the time.

When Rabin wanted to convince the Israeli public that concessions for peace didn't mean Israel would endanger its security, he sent Lipkin-Shahak to conduct talks with the Palestinians on his behalf. Pictures of the popular general walking on a sandy beach with a top Palestinian negotiator made their way into the press, and became a symbol of hope for better days. Martin Indyk, the U.S. ambassador to Israel at the time, recalled years later that “there was no one the Palestinians trusted more than Amnon, ‘the peace general.’”

Netanyahu, unlike his top general, thought that Rabin's diplomatic moves were a big mistake. He was elected on a promise to stall and if possible even reverse his predecessor's concessions.

The security establishment was almost uniformly against this approach, although there was a small faction within the IDF senior command closer in its analysis to Netanyahu. Most of the relevant generals and intelligence chiefs believed that even though the agreements Rabin had signed with the Palestinians were far from perfect (to say the least), the former prime minister's broad push to end the conflict was the right direction for Israel.

The generals' position soon became public through leaks and background briefings to the press. In reply, a hawkish Likud politician, considered close to Netanyahu, accused the military's senior command of undemocratic conduct, and bashed the generals as "suckers for the previous government and the Labor Party." Netanyahu publicly distanced himself from the harsh attack, but privately, he thought there was a lot of truth to it.

The tensions between Netanyahu and the top security chiefs reached a boiling point in late September of that year, when the prime minister decided to allow Israeli tourists into a previously restricted part of an ancient tunnel running underneath Jerusalem's Old City, one of the most religiously contested areas in the world. Netanyahu wanted to prove a point to his political "base" of religious right-wing voters: that no part of Jerusalem, even the city’s most disputed areas, would be off limits for Jews. The security chiefs feared that such a move was a needless provocation that would ignite fire on the Palestinian street. But Netanyahu had no interest in hearing their opinion. In fact, his final decision to go forward with the plan was made without even consulting them. “We heard about it from the news,” recalls Lavie, Lipkin-Shahak's close aide.

Hours after the tunnel was declared open, riots erupted in multiple Palestinian cities, and 17 Israelis and more than 80 Palestinians were killed over the next three days. In an attempt to calm down the Israeli public, Netanyahu summoned a hastily arranged press conference, and asked a number of security chiefs—including Lipkin-Shahak and the head of the Shin Bet, Admiral (ret.) Ami Ayalon—to stand beside him as he spoke to the nation. After keeping them out of the loop, he was now trying to use their familiar faces and well-regarded experience, to prove to the public that things were under control.

Then, planted news stories began to surface questioning the security chiefs’ role in the skirmish. Perhaps the entire mess was their fault? Perhaps they didn't do enough to warn the prime minister? A former senior security chief, who was an IDF general at the time, recalls that “people couldn't believe it. Bibi was trying to shift the blame to us. In the culture of the military, taking responsibility for your decisions is a core value. A commander can't make a mistake and then try to pin it on his soldiers. But that's essentially what Bibi was trying to do.” In a heated security cabinet discussion shortly afterward, Ayalon—usually known for his cool manner and civility—exploded at the prime minister, accusing him of not allowing the security chiefs to express their professional assessments before the government.

The “tunnel riots,” as they came to be known, damaged the security chiefs’ relationship with Netanyahu in ways that were beyond repair.

The Israeli public was exposed to the security establishment's frustration in early November 1996, when the country commemorated the first anniversary of Rabin's murder. The military held its main memorial event at a large concert hall in Tel Aviv, and Lipkin-Shahak was the prime speaker. Standing before thousands of officers and soldiers, he stated that he will “speak directly to Yitzhak today,” and then unloaded. “Yitzhak, it’s been a very hard year since you left us,” he said. “Polarization, hedonism, sectarianism and opportunism have reached the heart of our national consensus, while the IDF has been turned into a punching bag.” Lipkin-Shahak didn't mention Netanyahu by name—there was no need to. Everyone understood exactly what he was talking about. As one senior Mossad operative who was in the crowd recalls, "the air had the smell of a military coup.”

The next morning, Lipkin-Shahak's speech was on the front page of every newspaper. Israel's most popular talk-show host wrote a column stating that "this is the kind of leader we need." Netanyahu asked his pollsters to start testing the effects of a possible entry by Lipkin-Shahak into politics. The results were very worrying. Later on, when right-wing activists complained to Netanyahu that he wasn't doing enough to erase previous agreements with the Palestinians, he angrily told them that if they stopped supporting him, "you'll get Lipkin-Shahak as prime minister." The implications were clear: a return to Rabin's peace policies, and the possible emergence of a Palestinian state.

Netanyahu's prophecy eventually came true, but not exactly as he imagined it. In late 1998, his government collapsed and Israel went to new elections. Lipkin-Shahak, who by then was already out of the military, quickly announced he was running to replace Netanyahu. At the same time, the Labor Party chose Lt. General (ret.) Ehud Barak, Lipkin-Shahak's predecessor as the military's chief of staff, to be its candidate. To make things even worse for Netanyahu, his own defense minister, Major General (ret.) Yitzhak Mordechai, announced that he was leaving Likud for an independent run, describing Netanyahu as opportunistic, irresponsible and arrogant.

Eventually, in their united desire to see Netanyahu leave office, two of the generals, Lipkin-Shahak and Mordechai, stepped aside to clear the way for the third, leaving Barak as Netanyahu's only challenger. On election night, the former general won 56 percent of the popular vote. In front of tens of thousands of celebrators at Rabin Square—the site of the traumatic assassination in 1995—Barak declared it was "the dawn of a new day" for Israel. He promised to immediately renew peace talks with the Palestinians.

Early on May 18, 1999, celebrating Israelis crowd into Tel Aviv’s Rabin Square after Benjamin Netanyahu concedes to Ehud Barak in Israel’s general elections. Some carry portraits of assassinated Prime Minister Yitzhak Rabin. | AP Photos

For Netanyahu, it was the birth of a defining trauma. His rule was abruptly cut short by a development that seemed to come out of his most terrifying nightmares: a joint conspiracy by three decorated generals, who all turned their fire on him and managed to throw him out of office.

Over the next 10 years, as he was trying to salvage his political career, Netanyahu worked to execute what was perhaps the most important lesson of his 1999 loss: a mechanism to keep the generals out of politics.

The effort finally succeeded in 2007, when Netanyahu—by then once again the leader of the opposition—managed to wrestle through the Knesset a bill that made it illegal for retired security chiefs and generals to run for public office in the first three years after their retirement. Israel already had a law in place that forced retired generals to take a “cool-off period” of one year before entering politics, but the new bill multiplied that period.

After his 1999 loss, Netanyahu worked to pass a law blocking retired generals from running from office for four years after their retirement.

The bill certainly worked. After losing to Ehud Barak in 1999, and then enduring a crushing defeat by Ariel Sharon, arguably Israel's greatest general ever, Netanyahu finally won another election in 2009, when his main opponent, then-Foreign Minister Tzipi Livni, lost to him in public opinion polls on the question of who will deliver better security for Israel.

But the bill had another important consequence, which Netanyahu perhaps didn't expect: It freed the security chiefs serving under him to speak up in unprecedented ways. After all, no one could accuse them of attacking the prime minister because of their own political aspirations, as they were technically barred from entering politics. Netanyahu would soon discover that this was quite a heavy price to pay.

***

Three months ago, on a rainy Sunday morning in late March, Netanyahu's convoy arrived at Rosh Pina, a picturesque town of stone mansions and red roof tiles overlooking the Sea of Galilee in northern Israel. The dark-windowed line of cars made its way through the narrow streets of the town, stopping at the entrance to its historic cemetery, one of the oldest in the country.

Netanyahu was there to attend the funeral of the man who was his greatest rival within the security establishment in recent years: Meir Dagan, the former head of Israel's fabled Mossad agency who in life had described Netanyahu as “a danger to Israel,” “a coward who loses his balls in critical moments” and “the worst manager I’ve ever worked with.” Now, the prime minister was about to read a eulogy over his open grave.

The prime minister, of course, chose to focus on the more positive aspects of his relationship with Dagan. “I remember sitting with him to discuss secret operations, and just bursting in laughter because of how daring and even rude his ideas were,” Netanyahu recalled with a smile.

Meir Dagan, shown in this undated photo wearing his rank and his two citations for bravery, was appointed as the Director of the Mossad by Israeli Prime Minister Ariel Sharon on September 10, 2002. | Getty

In the crowd were a number of people who had followed Netanyahu’s tensions with Dagan from a close distance. Former Israeli President Shimon Peres talked about Dagan’s lifelong commitment to the Jewish state's security. The current Chief of Staff of the IDF, Lt. General Gadi Eizenkot, watched silently as a group of generals carried Dagan’s casket into the cemetery. Not far from him stood his friend and predecessor, Lt. General (res.) Gabi Ashkenazi, who led the military in the same years that Dagan headed Mossad. Also in attendance was Yuval Diskin, the former head of the Shin Bet and an expert in the field of targeted assassinations, who declared that Dagan's death left him “feeling like an orphan.” Many of those gathered at the cemetery agreed.

What all of these men had in common—besides their friendship with Dagan—was their own history of clashes with Netanyahu. Eizenkot and Ashkenazi over the issue of a possible Israeli strike against Iran; Diskin over the same issue, and also over Netanyahu's policy toward the Palestinians. These disputes weren't mentioned by any of the speakers, but they hung over the cemetery like a heavy cloud.

Dagan was famous in Israel for one thing: his expertise in killing the country's enemies. Under his watch, while serving under Prime Minister Sharon, Iranian nuclear scientists died mysteriously on the streets of Tehran. Top Hezbollah and Hamas operatives were blown up near the apartments of their mistresses. A senior Syrian general died while attending a party at his home. The assassinations created a legendary aura around Dagan. One prominent Egyptian newspaper declared that the stubby spymaster was in fact Superman.

But Dagan wasn't just a ruthless killer. Behind closed doors, he was also a powerful advocate for diplomacy with the Arab world and the Palestinians. Dagan believed that Israel shared two fundamental interests with many Arab regimes—preventing Iran from acquiring nuclear weapons, and stopping the spread of radical Islamic terrorism—and that this situation created promising opportunities for the Jewish state. Sharon and his successor, Ehud Olmert, both used Dagan for top-secret diplomatic missions.

Netanyahu, however, was elected in 2009 on the same hard-line platform from his earlier term, promising to prevent the foundation of a Palestinian state and to never evacuate even a single settlement in the West Bank. While Olmert spent his last year in office fervently trying to reach a peace deal with the Palestinians, Netanyahu brought with him the promise of a diplomatic stalemate.

In the background was a more consequential debate: How should Israel deal with the nuclear threat from Iran? Dagan and Netanyahu both believed Iran should never be allowed to produce a nuclear weapon, but that was about the only thing they agreed on.

Bibi has a tendency to exaggerate security threats,” says a former senior security chief. “As long as it’s just a political tactic, we can live with it. But when it starts affecting fateful security discussions—it becomes a problem.”

As late as 2011, Dagan was convinced that Iran was still relatively far from the bomb. Most of Israel's intelligence community supported his assessment. Netanyahu, on the other hand, was speaking—both in public and in private—as if Iran was on the verge of producing a nuclear weapon within months. "Bibi has a tendency to exaggerate security threats," says a former senior security chief, who was involved in the Iranian dispute. "He uses it to invoke fear in the Israeli public. As long as it's just a political tactic, we can live with it. But when it starts affecting fateful security discussions—it becomes a problem."

In addition to the timeline disagreement, Netanyahu and Dagan also had very different opinions on what was the right way to stop the Iranians. Netanyahu and Ehud Barak—who was now his defense minister—talked as if a military strike was the only solution. Dagan thought it would be a complete disaster. Since Iran's nuclear facilities were spread out around the country, it was almost impossible to annihilate the program completely. An Israeli strike, he believed, would only increase the Iranians' pursuit of the bomb, which would be described as a defensive necessity against Israel. The smarter way to deal with the problem, he insisted, was through a combination of secret sabotage efforts and strong international pressure led by the United States. Netanyahu grew afraid of using the former, and was always highly skeptical about the latter, especially with Obama sitting in the White House. Netanyahu didn't trust the American administration to eliminate the threat from Iran, and feared that Obama was intent on reaching a compromise with the Iranians that would hurt Israel's security.

Israel's other top security chiefs mostly agreed with Dagan. The military's chief of staff, Lt. General Gabi Ashkenazi, was responsible for building the capability to strike Iran, but believed that such a step should be the ultimate last resort—“only when the knife gets close to the skin of our throat." A strike would almost certainly lead to a full-scale war with Iran, in which thousands of missiles would land on Tel Aviv. Ashkenazi had no doubt that Israel would emerge victorious from such a war—but he also thought it was unwise to start it as long as there were other options.

Yuval Diskin, head of Shin Bet—the internal intelligence agency—strongly agreed. Although his agency was technically not involved in the debate over Iran, his prominence and experience got him a place in the security cabinet discussions—where he offered his support to Dagan and Ashkenazi’s positions.

In the summer of 2010, at the end of yet another long security cabinet discussion, Netanyahu and Barak asked Dagan and Ashkenazi to stay with them alone for a few minutes, and then revealed something that stunned the two security chiefs: They wanted the military to speed up its preparations for a strike on Iran, making it possible within a matter of weeks.

This is an illegal order,” Dagan told Netanyahu. “This means we are de-facto starting a war with Iran.”

Ashkenazi tried to explain that if the military sped up the preparations to fit this new schedule, there was a very high chance that Iran, sensing unusual movements on the Israeli side, would launch a pre-emptive strike. Dagan’s reaction was harsher. “This is an illegal order,” he told Netanyahu. According to Israeli law, the prime minister isn't authorized to declare war on another country—only the entire security cabinet can do that. “This means we are defacto starting a war with Iran. Get it first of all through the cabinet,” Dagan said.

Netanyahu and Barak were furious, but in consultations they held later that day, they both realized there was no choice but to back down: if such a vote actually took place, the security chiefs were very likely to persuade more than half of the cabinet members to oppose it, especially since the most experienced cabinet member on security affairs, Ya'alon (then holding the title of Minister for Strategic Affairs), was also not a big fan of the idea.

“Could Netanyahu and Barak have actually ordered a strike? I'm not sure,” says a former senior cabinet member. “Some of us thought at the time that all their talk about it was just brinksmanship, as part of an attempt to force Obama to take military action. But could they have gotten Israel into a very dangerous situation just by speeding up the preparations? I believe the answer is yes. Dagan, Ashkenazi and a number of ministers at the security cabinet saved us from war.”

Israeli Prime Minister Benjamin Netanyahu (left) and Defence Minister Ehud Barak prepare to give a press conference at the Israeli Defense Ministry in Tel Aviv, November 5, 2009. | Getty Images

The Israeli public had no idea that this fateful drama was unfolding until a few months later, when Dagan, on his last day before retiring from the Mossad, invited a group of senior Israeli journalists to the Mossad's headquarters for a very rare briefing on the Iranian issue. A strike on Iran, he told them, wouldn't solve the problem, but only make it worse. It was much smarter, he argued, to work closely with the United States on increasing the economic pressure.

Dagan was worried that as he and Ashkenazi, who also finished his term in 2011, exited the scene, Netanyahu and Barak would make another attempt at a strike. His unusual news briefing was soon followed by a string of public appearances, in which he carried the same message, even more sharply. “A strike on Iran? It's the stupidest idea I've ever heard of,” he said in a speech at the Hebrew University in Jerusalem. “I hear the assessment from the government that we have less than a year to act,” he added in a TV interview, “I totally reject that assessment.”

Dagan's attacks were met with blistering criticism from Netanyahu's supporters. One right-wing minister even suggested that Dagan should be put on trial for exposing state secrets. “I’ll be glad to,” Dagan replied with a smile. “Israel is a democracy, last time I checked. People like myself still have a right to say what's on their mind.”

***

Netanyahu was furious at Dagan, but he refrained from personally hitting back. The prime minister, unlike the wider Israeli public, was aware of the fact that Dagan had just been diagnosed with advanced stages of cancer. He wasn't going to turn into a political threat. There was no reason to lose sleep over him.

The same couldn't be said of Dagan's two main partners in shooting down the Iran strike—Ashkenazi and Diskin. The prospect of one of them joining politics in the future and re-enacting the events of 1999 seemed more than likely to Netanyahu and his top advisers.

Ashkenazi was the one they feared most. The charismatic general, appointed chief of staff in 2007, enjoyed overwhelming popularity among the Israeli public, which credited him with restoring the military's sense of confidence after Israel's problematic 2006 war in Lebanon. Israel's top-rated satire program, which routinely mocked Netanyahu, gave Ashkenazi the exact opposite treatment, portraying him as a humble and gruff soldier who ate pita bread with scorpions for lunch at the training ground.

Like Dagan, Ashkenazi was a lifelong warrior who nevertheless believed that Israel's security could be strengthened by diplomacy. A former senior aide of his says that in late 2007, after the IDF successfully destroyed a nuclear reactor in Syria, Ashkenazi sent a personal letter to then-Prime Minister Olmert, expressing his view that this impressive demonstration of force had created good conditions for Israel to engage in new diplomatic initiatives. Under his tenure as chief of staff, the IDF also increased its cooperation with the security forces of the Palestinian Authority, despite the stalemate on the diplomatic front.

Israeli army chief Lieutenant-General Gabi Ashkenazi holds his head in his hand before a briefing, June 17, 2007. | Getty Images

By the time he was nearing the end of his term, Ashkenazi was enjoying the status of a political messiah among the Israeli center-left bloc. In the Knesset, there was chatter about an attempt to cancel the 2007 "cool-off period bill" so that Ashkenazi could join politics a year after taking off his uniform. Netanyahu's advisers accused the chief of staff of "laying the foundations for his future political career while he was still in the military," an accusation fiercely denied by those close to Ashkenazi.

When he did eventually become a civilian in 2011, Ashkenazi's political potential immediately plummeted, as a result of a wide-ranging police investigation that broke out against him and his closest aides. At the heart of the probe was Ashkenazi's very troubled relationship with Defense Minister Barak—their top aides, it was discovered, had run spying operations on each other. The main beneficiary from the mess was Netanyahu: The investigation dragged on until 2016, with no indictment against Ashkenazi or any of his people. Netanyahu, meanwhile, was spared the need to run against a popular figure like Ashkenazi in the two election cycles that took place in between.

Ashkenazi's sidelining cleared the way for the third security chief who clashed with Netanyahu during those years, Yuval Diskin, to become the new great moderate hope. Like Meir Dagan, Diskin was an expert in targeted assassinations. Like Dagan, he was appointed to lead his agency, the Shin Bet, by Ariel Sharon. And like Dagan, he had developed a strong contempt toward Netanyahu.

Diskin wasn't as well known to the general public as Dagan and Ashkenazi. The Shin Bet's work, unlike that of the Israeli military and the Mossad, doesn't appear a lot in the media. The agency is basically responsible for spying on the millions of Palestinians living under Israeli control. As one former head of the agency told me, "we swim inside the sewage tunnels, so Israelis can get drinking water in their taps. It's not something people want to talk about over dinner.”

Fluent in Arabic and intimately familiar with hundreds of Palestinian villages, towns and neighborhoods, Diskin had no illusions about the people with whom Israel had been in conflict for decades. But like the overwhelming majority of Israel's security and intelligence chiefs, he strongly believed that it was possible to make progress towards peace—and that the alternative policy, of entrenching Israel's settlements in the West Bank, would have disastrous consequences.

They had no idea what his policy really is. One day he's for a Palestinian state, the next day he's against it. He says something in English to the Americans, and contradicts himself a week later in Hebrew.”

In late 2009, when Netanyahu—under strong pressure from the Obama administration—agreed to accept the two-state solution and open peace negotiations, Diskin thought that perhaps he was going to witness a strategic shift in the prime minister's policies. But just like the American administration, Diskin soon became convinced that Netanyahu wasn't negotiating in good faith.

"As a security chief, you shouldn't have any problem working for a prime minister you don't agree with," says a person close to Diskin. "But I think Yuval and the other security chiefs found it impossible to work with Bibi, because they had no idea what his policy really is. One day he's for a Palestinian state, the next day he's against it. He says something in English to the Americans, and contradicts himself a week later in Hebrew at the Likud faction.”

When Diskin left the Shin Bet in 2011, his low profile held on for almost a year. But when he finally opened his mouth, it was like a volcanic eruption.

It started with a rare public appearance in which Diskin called Netanyahu "messianic" and claimed the prime minister was lying to the Israeli public regarding the timeline of Iran's nuclear progress. “I don't trust him,” Diskin said. “He and Ehud Barak are not the kind of people I want to see leading the country in the event of a war.” The Israeli press rejoiced, turning the former Shin Bet chief's combative speech into the top news story in the country.

Next came a lengthy interview Diskin provided to a documentary film called “The Gatekeepers.” The film's director, Dror Moreh, set out to interview all the living former heads of the Shin Bet, in order to ask them what they thought were the implications of Israel's decadeslong occupation of the Palestinians. All of them said, each in his own words, that Israel had to make a serious effort to end the conflict. The strongest moment in the interview with Diskin was when Moreh read aloud a quote by Prof. Yeshayahu Leibowitz, a famous Israeli intellectual, who warned back in 1968 that if Israel kept the occupied territories, "it will be inflicted with the corruption typical to colonial regimes. The government will constantly have to deal with oppressing an Arab rebellion, and with acquiring Arab Quislings. The IDF will suffer from atrophy and become an occupation army.” Moreh then asked Diskin: "What do you think about this statement, when you look at the state of Israel today?" Diskin looked straight into the camera and said: "I agree with every word of it.”

“The Gatekeepers" was a huge success, winning a number of prestigious prizes and an Academy Award nomination in the documentary category. Netanyahu, however, announced publicly that he had no intention to watch the film, and Israel's minister of Culture, a member of Likud, expressed satisfaction when it fell short of winning the Oscar.

Behind these angry reactions was fear of the film's impact, both in Israel and abroad. The six men who were interviewed by Moreh were not the usual left-wing, liberal critics of the Israeli occupation. They were, in many ways, the occupation itself. The fact that all of them spoke out in favor of a two-state solution, at the same time Netanyahu was busy explaining why such a solution was impossible to reach, became a source of great embarrassment for the prime minister. Diskin’s interview became the ultimate public example of the rift between Netanyahu and his own security establishment.

Diskin's tormenting of Netanyahu was far from over. In January 2013, Israel was scheduled to hold new elections. Netanyahu was basically running unopposed, but the main question of the elections was how many Knesset seats Likud would receive. Netanyahu was hoping to get 45, a number that would all but guarantee great stability for his next government. The polls indicated this target was within reach.

Two weeks before Election Day, the country's most popular newspaper published a front-page interview with Diskin, containing what was possibly the most scathing attack Netanyahu had faced during his entire career. Diskin described Netanyahu, Barak and then-Foreign Minister Lieberman sitting around smoking cigars casually during a discussion about a war with Iran that could potentially lead to widespread destruction in Tel Aviv: “The defense minister gets up, walks to the bar in the same room, and pours himself a drink. Just like that, in the middle of such a consequential discussion, he's standing there, with his alcoholic beverage in hand. I can't even begin to describe, to tell you the image we're seeing in front of our eyes …

“One of the ministers sitting there has trouble breathing. I ask him—aren't you bothered by the cigars? And he says, yes, very much. So I tell him, why don't you say something to them? And he answers, ‘I’ve told them, but what can I do? They don't listen.’”

With Netanyahu and Barak … the personal, opportunistic and immediate interest always comes first,” said Diskin.

And there was more:

“Ever since 1994, I've worked in close proximity to Israel's most senior leadership,” Diskin said. “I've seen all kinds of leaders—Rabin, Peres, Netanyahu, Barak, Sharon, Olmert and once again Netanyahu. With most of them, I felt that at the moment of truth, when there could be a clash between their personal interests and those of the state of Israel, they will always put the national interests of Israel above anything else. And unfortunately, many of my colleagues in the senior ranks of the security establishment feel that with Netanyahu and Barak, it's not like that. For them, the personal, opportunistic and immediate interest always comes first.”

***

Netanyahu managed to survive Diskin's attack—two weeks later, he was still the country's prime minister. But the election results were a great disappointment for Likud: Instead of getting close to 45 Knesset seats, the party just barely passed 30. And while there were many reasons for this last-minute collapse, Netanyahu's postmortem analysis showed that the attacks on him by the veterans of the security establishment had an important effect: they caused many Israelis to second-guess his insistence that no one else could deliver better than him on security.

The prime minister, however, was already working on fixing that problem, even before the elections. In 2011, when the three combative security chiefs left their posts, Netanyahu was determined to replace them with people he would find easier to work with: less independent, less charismatic, and if possible, closer to his worldview.

In the Shin Bet, Netanyahu ignored Diskin's recommendation to promote his own deputy, and instead appointed Yoram Cohen, the first chief in the history of the agency to come from Israel’s national-religious sector, which is mostly right wing and supportive of Netanyahu’s policies. Cohen, who recently completed his term, was indeed much better for Netanyahu than his predecessor, but even under his leadership, disagreements between the prime minister and the agency surfaced from time to time. On a number of occasions, Cohen publicly contradicted Netanyahu's statements against Palestinian President Mahmoud Abbas, saying that contrary to the prime minister's portrayal of Abbas as a terror supporter, the Palestinian president was in fact opposed to violence and committed to security cooperation with Israel.

In the Mossad, Netanyahu appointed Tamir Pardo, a man who was, on paper, the complete antithesis of Dagan and as a Netanyahu family friend someone the prime minister thought he could depend on as an ally. But during the years 2011 and 2012, Pardo made clear in Israel's most secretive security forums that he thought an Israeli strike on Iran would be a mistake. "He basically inherited Dagan's position," says one former Israeli official who participated in dozens of discussions on Iran together with Pardo. Pardo advocated for a tough line of action against Iran, involving covert operations and economic pressures. But when it came to Netanyahu's desire to send Israeli warplanes to Iran, he was very skeptical—and so was the new IDF chief of staff, Lt. General Benny Gantz, who told Netanyahu that if he gets an order to attack Iran, he will fulfill it, but not before officially telling the government that it was a dangerous mistake.

Thanks to their opposition, the year 2012 went by without a strike on Iran. In June 2013, the prospects of a strike all but vanished after Hassan Rouhani won the presidential elections in the Islamic Republic. The White House greeted the results by expressing hope that under Rouhani's supposedly moderate leadership, a nuclear deal could be reached. Netanyahu's reaction offered a clear contrast: "Nothing changed in Iran last night," the prime minister announced. He insisted that Iran was still intent on building a nuclear bomb and then wiping Israel off the map.

The Israeli security establishment didn't accept Netanyahu’s “all is dark” analysis of the election of Hassan Rouhani in Iran.

The Israeli security establishment didn't share the American administration's full-throated optimism, but it also didn't accept Netanyahu's “all is dark” analysis. The commander of the military's Intelligence Corps, Major General Aviv Kochavi, sent the prime minister a special assessment (approved by Gantz) claiming that Rouhani's rise to power signaled “a major strategic shift” in Iranian politics. The Mossad also considered the election results a major turning point for Iran, which was still a dangerous enemy to Israel, but not necessarily one headed for the possession of nuclear weapons in the near future.

Perhaps it was this reading of events that led Pardo, in the summer of 2014, to spurn Netanyahu once again, by saying that “the greatest risk to Israel's national security isn't Iran—it’s the conflict with the Palestinians.” This one sentence, uttered at a briefing Pardo gave to senior Israeli business executives and leaked to Ha'aretz newspaper, contradicted everything Netanyahu had been saying for almost two decades: that Iran is Israel's greatest challenge, and that the Palestinian issue was being over-hyped because of the media's “childish obsession,” as Netanyahu's confidant Ron Dermer once said.

Pardo's comment was bad for the prime minister not only because of its content, but also because it so closely echoed a statement made a few months earlier by Diskin. Speaking at a pro-peace rally in Tel Aviv, the former Shin Bet chief declared that "the implications of not finding a solution to our conflict with the Palestinians are much more dangerous than Iran." When his words hit the headlines, Netanyahu's office quickly shot back, stating that "anyone who believes the Palestinian issue is more dangerous than Iran is clearly delusional.”

Netanyahu personally approved the nasty reaction; now, when Pardo repeated Diskin's position, it came back to haunt him. “Does the prime minister think Pardo is also delusional?” journalists were quick to ask. Trying to save face, Netanyahu's office forced Pardo to issue a clarification.

It wasn't the last time such a dictation would be necessary: Half a year later, in January 2015, Pardo met with a group of American senators visiting Israel, and surprised them by warning about the dangers of approving new sanctions legislation against Iran. The very same legislation was enjoying the active support of Dermer—Israel's ambassador to Washington—yet here was the head of Mossad, telling lawmakers it was akin to “throwing a hand grenade” into the nuclear negotiations, all but ensuring a new war in the Middle East.

Unlike some commentators in Israel who assumed Pardo's words came out as a result of unintended sloppiness, Netanyahu suspected that the Mossad chief knew exactly what he was doing (Time magazine reported that he had tried to block Pardo from meeting the group). And the timing couldn't have been worse: Pardo's words were leaked less than 24 hours after it was announced that Netanyahu had been invited by the Republican leadership to speak before Congress against the impending nuclear deal.

At a Likud party office in the city of Netanya, Israelis watch a TV broadcast of Israeli Prime Minister Benjamin Netanyahu’s address to the U.S. Congress. | Jack Guez/AFP/Getty Images | Getty Images

The security establishment almost unanimously believed Netanyahu’s speech before Congress was a mistake. But while the current security chiefs could only express their opposition to it behind closed doors, their retired predecessors were free to speak about it publicly, and quite harshly. "Bibi, I taught you how to navigate," said Major General (ret.) Amiram Levin, who was Netanyahu's commander during his mandatory military service in an elite commando unit in the 1970s. "It seems like you've lost your compass. Our enemy is Iran, not the United States.”

A few months later, as the prime minister was desperately fighting to stop Obama from reaching a veto-proof majority for the Iran deal in Congress, dozens of former Israeli generals and spymasters spoke out against his decision to go head-to-head against the U.S. president. A smaller group of former security chiefs, including one former head of Israel's Atomic Energy Commission, even made their way to Washington to brief members of Congress in support of the deal.

Israel’s security establishment almost unanimously believed Netanyahu’s speech before the U.S. Congress was a mistake. “Our enemy is Iran, not the United States,” said Major General (res.) Amiram Levin.

The Obama administration used the former generals’ statements to sell the deal to skeptical lawmakers. Major General (ret.) Ya'akov Amidror, Netanyahu's former national security adviser and one of the few former generals who have consistently backed the prime minister, says this had an important effect on the final outcome in Congress: "The average congressman, especially a Democrat, wants to side with Israel, but siding with Israel is very different than siding with Likud", he explains. "The fact that these former security officials contradicted the prime minister helped present this as a controversial issue not just in America, but also in Israel.”

Watching from the sidelines, Pardo and the new military chief of staff, Lt. General Gadi Eizenkot (who replaced Gantz in early 2015), carefully stayed out of harm’s way. They didn't join the former security chiefs in supporting the deal, but also didn't join Netanyahu's public fight against it.

***

Netanyahu's loss on the Iran deal marked a low point in his career. And yet, his future biographers will most likely describe the year 2015 as one of great success for the prime minister, mainly for his impressive victory in the elections that were held in Israel on March 17 of that year.

Beating his main competitor in those elections, Isaac Herzog, a lawyer-turned-politician with zero security credentials, wasn’t hard for Netanyahu to do. Still, in many ways, his real fight wasn't against Herzog—but instead, against his old rivals, the veterans of the security establishment.

The first shot was fired by Meir Dagan, who despite his deteriorating health, appeared at an event commemorating his old friend, Sharon, two months before Election Day, and lashed out at Netanyahu. “His policies are leading Israel towards becoming a bi-national state. It's a disaster,” Dagan warned. Next came Diskin, who threw his support behind Herzog. In a post he published on his Facebook page, the former Shin Bet chief—who had refused requests by hundreds of citizens, and also by Dagan, to enter politics himself—explained that “no one can be worse than Netanyahu. He represents six years of constant failures."

The former Shin Bet chief was unsparing: “No one can be worse than Netanyahu. He represents six years of constant failures.”

Four days before Election Day, Netanyahu received the hardest blow, when dozens of former generals, Mossad and Shin Bet officers, and even senior veterans of the police, published a joint appeal to the public to throw him out of office. The unprecedented onslaught was led by Major General (ret.) Amnon Reshef, famous in Israel for his crucial role in pushing back the Egyptian Army in the 1973 war. “Israel deserves a better leadership,” he announced at a news conference in Tel Aviv, warning that Netanyahu's behavior toward President Obama was a threat to Israel's strategic alliance with the United States.

And yet, facing the strongest resistance any Israeli prime minister had ever encountered from the country's powerful security establishment, Netanyahu managed to prevail. Likud beat Labor by six Knesset seats, Netanyahu won another term, and for the first time in his career, he had clearly overcome his former uniform-wearing rivals.

Copies of ballots papers and campaign posters for Israel's Prime Minister Benjamin Netanyahu's Likud Party lie on the ground in the aftermath of the party’s victory in parliamentary elections, March 18, 2015. | Jack Guez/AFP/Getty Images | Getty Images

His decision to appoint Lieberman as defense minister in May, a year and two months after the elections, was a second straight victory. And the long-term demographic trends in Israel as a whole, and in the military in particular, are also working in his benefit, as the national-religious sector in Israel, known for its overwhelming support of Netanyahu's right-wing policies, is slowly becoming more prominent inside the midlevel ranks of the IDF.

Isaac Herzog’s disappointing loss in the last elections has convinced many Israelis in the center-left bloc that only a glorified war hero—someone like Barak in 1999, or Sharon in 2002—can beat Netanyahu. There isn't a lack of candidates for the job. Perhaps it will be Ya'alon, the disgruntled former defense minister, who for the past decade was one of the very few former generals to publicly support Netanyahu, but now has joined the ranks of the prime minister's enemies. Or maybe it will be Ashkenazi, who has finally put the legal ordeals behind him, and still enjoys great popularity. Gantz, who will have to wait until 2018 before entering politics, and Diskin, who has gone quiet for the past few months, are also considered strong potential candidates.

In the past eight years, as Netanyahu endlessly fought with President Obama, the U.S. administration managed to maintain excellent ties with Israel's security system, despite the political tensions. Israel's top-rated investigative television program, "Uvda," even revealed recently that Meir Dagan for years had a direct communication channel with Obama's first-term CIA director, Leon Panetta, over the head of Netanyahu. Such a scenario seems very unlikely to repeat itself in the future. The inconvenient truth is that unless one of these former generals beats Netanyahu in the next elections, the next U.S. administration will have to get used to a new reality in the Jewish state: one in which the most right-wing elements in the political system are gaining more and more power and influence at the expense of the "old guard" of Israel's security establishment.

What will be the policy implications of these developments?

On the Iranian front, Netanyahu's options are very limited at the moment. The security chiefs currently in office, such as IDF chief of staff Eizenkot, have made it clear that they believe the nuclear deal with the Islamic Republic has decreased the level of threat to Israel in the near future. Netanyahu probably won't be able to carry out a strike against the professional advice of his own military leaders, especially after their objections have become public. If, however, the nuclear deal looks shaky a year from today, an Israeli strike could definitely be once again put on the table—and it's not clear at all if this time there will be someone strong enough in Israel to block it.

When it comes to the Palestinians, things are even more complicated. Despite his hawkish opinions, Moshe Ya'alon routinely accepted the advice of the IDF senior command to do as much as possible to distinguish between Palestinian terrorists and the general Palestinian population—or, in the words of one senior general still in service, "to convince the average Palestinian that he doesn’t have to become a terrorist."

Lieberman, however, has advocated in the past for collective punishments, and started his term in the defense ministry by vowing to take down Hamas' rule in Gaza the next time a conflict erupts on Israel's southern border. Peace negotiations don't seem like an even remote option at the moment. This new reality creates a daunting challenge for Israel's security chiefs. A few months from now, it will probably create a similar headache for the next U.S. administration.