They both won and they both lost.
Before the clock struck midnight on election day, both Benny Gantz, Israel's new political performer, and Benjamin Netanyahu, the old master, triumphantly declared victory.
Mr Gantz, a tall and telegenic former military chief, strode back and forth across the stage of his Blue and White alliance's headquarters in Tel Aviv, clearly savouring this new sensation - that electricity after a bruising political battle, rather than the brutal wars he once had to fight.
Mr Netanyahu, his performance perfected by years of practise, stood in a shower of glittering confetti with one arm wrapped around his beaming wife, Sara, and the other waving to his faithful supporters at the Likud party's headquarters.
Then, in the cold political light of day, with nearly all the votes counted, both men's parties had each secured 35 of 120 seats in Israel's parliament, the Knesset.
But, in Israeli politics, a day of voting can matter less than the weeks of wheeling and dealing it will take to forge a governing coalition. This is a country where no political party has ever ruled on its own.
And this is where the maths and the man they call "Bibi the magician" converge. Mr Netanyahu now seems to have a clear advantage given the strength of right-wing and religious parties in the new Knesset. He even boosted Likud's strength in parliament.
"It's a comfortable win for Bibi," says Anshel Pfeffer, a journalist with Israel's Haaretz newspaper who has written a biography of the Israeli leader. "There's no other way to put it today."
"There is a very large number of Israelis who believe he is most suited to be prime minister and ensure security, despite the allegations of corruption against him."
Mr Netanyahu's strong relationships with world leaders, including US President Donald Trump, and his new outreach to Arab states, have played to his advantage and Israel's place on the world stage.
But assembling allies will not be easy, nor without costs, after what has been called the dirtiest election campaign in Israeli history.
It was also fought against the backdrop of Mr Netanyahu's possible indictment on corruption charges.
Mr Netanyahu has denied any wrongdoing, and accused the media and left of launching a "witch hunt" against him and his family, but he will be bargaining not just for his political future when he tries to woo partners.
He hopes they will either stand by him if he is charged following a final hearing or possibly pass legislation that would grant prime ministers immunity from prosecution while in office.
And potential right-wing partners are visibly fuming over his tactics and tricks, including 11th-hour pleas to voters to throw all their support behind Likud or the "left is going to win".
But Mr Netanyahu could look in different directions.
"He has lots of options," assesses pollster Mitchell Barak, who has worked with many Israeli leaders in the past, including Mr Netanyahu.
"He can go with right of centre, a narrow government, a national unity government with Gantz, or some combination."
So far, Mr Netanyahu has spoken of turning to his "natural partners".
Mr Gantz, who may have learned a little political lesson of not jumping in jubilation so soon, is also looking closely at this political arithmetic to see if numbers could add up differently to convince President Reuven Rivlin to see him as the man best placed to make this work.
But, wherever these new numbers take Israel, Mr Gantz has made his mark.
"The economy is strong, security is strong, and yet a new politician was able to build a legitimate and formidable alternative to the ruling party, within a couple of months and virtually out of nowhere," points out Yohanan Plesner, president of the non-partisan Israel Democracy Institute.
"Nevertheless, the outcome clearly constitutes a fresh boost of support to Mr Netanyahu, as this election was seen as a referendum on his leadership and priorities for the nation."
Mr Gantz - a career soldier who had to learn on the job, sometimes stumbling and stuttering in front of the unforgiving glare of TV cameras - carried out an effective ambush.
Blue and White - which was formed only weeks ago by Mr Gantz's Israel Resilience party, the Yesh Atid party of former Finance Minister Yair Lapid, and the Telem party of former Defence Minister Moshe Yaalon - challenged the might of the Netanyahu machine.
But its vague centrist platform, fuelled by an anti-Netanyahu drive, did not convince enough Israelis to gamble their future on it.
In this election, other numbers are being noted.
New far-right parties, seen by many Israelis as racist and homophobic, do not appear to have crossed the electoral threshold.
They included the ultra-nationalist, libertarian Zehut party of Moshe Feiglin, a star of the campaign who calls for legalising marijuana, rebuilding the Third Temple on the contested holy site in Jerusalem known to Jews as Temple Mount and to Muslims as Haram al-Sharif, annexing the occupied West Bank and encouraging Palestinians there to leave.
And on the left, the Labour party, which once dominated the Israeli political landscape, continued its retreat and looks likely to end up with only six seats.
"The Blue and White alliance is the new old Labour party," says the former Labour MK Einat Wilf, who calls Labour "the party which used to produce prime ministers". "It's a remarkable achievement."
And despite a historically low turnout among Israeli Arabs, which led to warnings of political extinction, two Arab alliances, Hadash-Taal and Balad-United Arab List, managed to secure six and four seats respectively, although that still marks a decline.
The memory of Mr Netanyahu's warning, in the 2015 election, that Arabs "were voting in droves", still stings in this community, as does the "nation-state" law passed last year that says Jews have a unique right to national self-determination in the country and puts Hebrew above Arabic as the official language.
The disillusion and despair in Palestinian communities in the West Bank and Gaza will be even greater as they see the results of an election, in which they had no say, that will shape their future.
"There's no difference between one party or another," comments veteran Palestinian politician Mustafa Barghouti, chairman of the Palestinian National Initiative. "All of them are calling for the continuation of the occupation and settlement building."
Weeks remain before the final shape of Israel's 21st Knesset will be clear.
And summer will bring more political heat.
Mr Netanyahu could make history by becoming Israel's longest-serving prime minister, surpassing the country's founding father David Ben-Gurion. He could also become the first prime minister to be indicted in office.
But this election has underlined again how Bibi knows, one way or another, how to keep fighting back.