More than 20 years ago, Ehud Barak was Benjamin Netanyahu's commander in the army's most elite unit, "Sayeret Matkal", a crack force called into service only when the smartest and fittest of men were required. Now, unless every pundit and pollster in the country is wrong, the Israeli public has judged Mr Barak smarter and fitter than Mr Netanyahu, and elected him to take over the command of Israel.
Neither a Shimon Peres-style dovish visionary, nor a more honest but equally hawkish version of Mr Netanyahu, Israel's new prime minister is, rather, the natural heir to another general-turned-politician, Yitzhak Rabin. Like Mr Rabin, he reached the very top of the Israeli army hierarchy, the office of chief-of-staff. Like Mr Rabin, he has now risen, rapidly, to the very top of the Israeli political tree. And, like Mr Rabin, he intends to use that newly-won position to engineer a series of pragmatic peace treaties with Israel's Arab neighbours not out of love or even affection for the Arabs, but out of a belief that long-term security for Israel can only be guaranteed through just and permanent peace accords with the adjoining countries.
Mr Barak's victory yesterday was, in good part, a personal rejection of Mr Netanyahu - a leader recognised by many of his countryfolk as duplicitous and untrustworthy. Some analysts argue that Mr Netanyahu was ousted because of the collapse of the peace process with the Palestinians. But it can equally be argued that he was defeated despite Israelis' satisfaction as regards that process. After three years of the Netanyahu government, the fact is, Israelis went to the polls yesterday feeling considerably more secure than they had in 1996, when the suicide bombers of Hamas were blowing up buses and shopping centres.
The peace process may have stalled, but average Israelis have not paid a personal price for the breakdown. Nobody's army service has been extended as a consequence. No new wars have broken out. The Israeli-Palestinian "crisis" has been felt much more acutely in diplomatic than domestic circles. And yet the electorate threw out Mr Netanyahu - because, it seems, they felt they deserved a more honourable man as their prime minister.
In the course of the campaign, up to and including polling day, Mr Netanyahu tried every trick in the book - and some from outside its pages - to overhaul Mr Barak. He broke election propaganda restrictions yesterday by giving live interviews on pirate radio stations. His activists pasted up overtly racist slogans, declaring that "the Arabs are voting Barak." He tried to make political capital out of the death of an activist from his Likud party, who apparently collapsed and died following a verbal argument with a Labour supporter, until the dead man's family warned that they would sue.
Mr Barak was not elected on a great wave of personal support. He is not a skilled TV performer like Mr Netanyahu. He is not especially charismatic. Though likeable in person, and unusually well rounded for a long-term military man - he has a BSc in mathematics and physics, an MSc in systems analysis, reads widely and plays piano well - he conveys little personal warmth, and often appears smug and overly pleased with himself. But, like his mentor Mr Rabin, he does radiate integrity, a commodity that has been in precious short supply here these past three years.
He has also attracted support by stressing a desire to heal the rifts in Israeli society - between Orthodox and secular Jews, Middle Eastern-born (Sephardi) and European-born (Ashkenazi) Israelis, left-wingers and rightists. Mr Netanyahu talked of doing much the same, of course, three years ago, but spent much of this election campaign, and no small part of his term in office before that, trying to delegitimise the secular left. Mr Barak, by contrast, already has done more than offer promises: He folded his Labour Party into a pre-election alliance with the Sephardi working-class Gesher party and with the moderate Orthodox movement, Meimad. He has promised to bring a new Centre Party, dedicating to building consensus, into his coalition. And he could even invite Mr Netanyahu's defeated Likud to join him as a junior coalition partner as well. Mr Barak, it seems, has learned the bitter lesson for which Mr Rabin paid with his life: Israel cannot be ruled by a government representing barely half of the people.
A wide coalition would bring its problems - not least on the central issue of how much land to trade for peace, in the West Bank with the Palestinians, and on the Golan Heights with the Syrians. Mr Barak says he is ready to be generous on both fronts. Right-of-centre coalition partners would doubtless attempt to frustrate such generosity. But as the directly-elected prime minister, Mr Barak has plenty of power. Even with his rocky coalition, Mr Netanyahu proved well capable of halting peace moves; Mr Barak will certainly be able to restart them.
His platform on the Palestinians bears many resemblances to the policies Mr Rabin was following. For instance, he would insist on retaining the strip of Jewish settlements in the West Bank along the border with the Jordan, the bloc of settlements around Jerusalem, and the series of settlements along what was, until 1967, Israel's "green line" border with the West Bank. Other settlements, deep in the heart of the West Bank, however, have less importance for him. Unlike Mr Netanyahu, he is not determined to prevent the Palestinians from extending sovereignty across a substantial, contiguous expanse of territory running the length of the West Bank.
Again like Mr Rabin, Mr Barak is cagey about how much land on the Golan Heights he would relinquish in return for a peace treaty that would normalise relations with Damascus and with Beirut. Instead, he promises to bring any peace treaty to a referendum. "The people will decide," he declares.
Rebuilding Israel's fragile relationship with the Arab world will be difficult after the frustrations of the past three years. But Mr Barak is well equipped to do it. He is, after all, as one of his Sayeret Matkal subordinates once acknowledged, "highly imaginative and very innovative". Who was that junior officer?
Step forward Benjamin Netanyahu.