On Tuesday, Bibi Netanyahu gave the speech of his life before a joint session of Congress — and he has Barack Obama to thank for it.

Yes, the very same Barack Obama who hates Bibi, the same Obama who was furious the speech was being given at all, walked the bases full for Netanyahu and served up the sucker pitch he hit for a grand slam.

For six weeks, the president and his team have been letting it be known just how angry they are that the leader of the House of Representatives invited the Israeli prime minister to speak about the threat from Iran.

The enraged leaks and overt hostility toward the head of state of an ally have been unprecedented.

The White House even tried to engineer a mass Democratic boycott of the speech, an effort that either (take your pick) met with success because 50 members of his party agreed to it, or was a failure because 75 percent of elected Democrats on Capitol Hill defied him and chose to attend.

What did all of this do? It made the Netanyahu speech the most important political event of 2015 by far.

It elevated Netanyahu’s powerful case against a nuclear deal with Iran to the highest level possible — so that the leader of a country of 8 million people roughly the size of New Jersey now possesses as much authority to discuss the issue as the leader of the free world.

Obama’s own national security mouthpiece, Ben Rhodes, has said the White House views a deal with Iran as the “biggest thing President Obama will do in his second term on foreign policy.”

Obama’s fit of pique against Netanyahu has led to a man-to-man showdown that will likely complicate that “biggest thing” immensely.

Netanyahu yesterday laid out, calmly and comprehensively, the reasons the deal is likely to be a bad one — and he had not only an audience of Americans vastly larger than he would’ve had if the president hadn’t had his hissy fit, but also the ear of the audience that matters most in this regard.

That audience is the United States Senate.

And his audience heard him.

Tuesday afternoon, after Netanyahu scored his success, Senate Majority Leader Mitch Mc­Connell announced he’ll bring up a piece of legislation requiring Senate consideration of any Iran deal for 60 days.

We can assume that the entire Republican caucus, 54 members in all, will be on board.

The bill will likely garner a healthy number of Democratic votes as well, led by the example of New Jersey’s Robert Menendez, the Senate’s most resolute voice on Iran.

But Obama will certainly veto any such legislation. It will take 67 votes to override a presidential veto.

Those who oppose a bad deal with Iran saw encouraging signs that this veto override might happen before the Netanyahu speech. McConnell clearly believes Bibi has made that all the more likely.

Almost from the outset, I thought the speech was a bad political idea — on the grounds that Netanyahu should’ve understood just how enraged the whole plan would make the president, whose hostility to Israel is nearly unprecedented.

Well, I was wrong.

I forgot I was talking about Barack Obama here, whose own political smarts extend as far as his own brilliance in getting himself elected and no further.

The president thought (and I thought) he could use the coming speech to set up a confrontation with Bibi that would make his job of selling the Iran deal easier.

It might have worked if the speech had been a dud. You know, like Obama’s own State of the Union, delivered on the very same spot six weeks ago.

But it wasn’t. It was a triumph — because, unlike Obama, Netanyahu had something of surpassing importance to say, and he said it with force, with strength, with conviction and with grace.