Before last week’s presidential debate, the conventional wisdom was that it would be a more subdued encounter — because it is hard to attack your opponent in a town-hall format. Well, as we all saw, the conventional wisdom was dead wrong. So we should take with a grain of salt the talk about how tonight’s foreign-policy debate will be a more serious and subdued affair. It will be a slugfest — because Barack Obama has no choice but to come out swinging.

Mitt Romney has the momentum going into tonight’s debate. He is rising in polls and has persuadable voters moving his way. He does not need a decisive win tonight. His goal should be to look presidential — to come across as serious, knowledgeable and ready to be commander in chief. His objective will be to make a clear and effective case against Obama’s global leadership, to lay out an alternative vision for America’s role in the world and, above all, to not say anything that disqualifies him for the job in the eyes of persuadable voters.

Obama, by contrast, needs a clear and decisive win. Because the momentum is against him, a tie that simply slows Romney’s momentum won’t be enough — he needs to reverse it.

So he will go on the attack and try to disqualify Romney as a potential commander in chief. He will make fun of Romney’s foreign-policy trip this summer — if he can’t go to the Olympics without offending our closest ally, how is he going to rally our allies to stop Iran’s nuclear program? Obama will make the case that Romney is the second coming of George W. Bush, who regrets ending the war in Iraq, wants to keep us at war in Afghanistan and wants to start another war with Iran.

Romney will respond calmly by arguing that he wants to avoid war — and that the best way to prevent war is to make sure your adversaries don’t doubt your resolve or your capabilities. He will point to the Middle East on fire and describe it as the result of a policy of U.S. weakness. On Iran, he will point out that Obama’s policy is failing — that Iran has made more progress toward a nuclear weapon in the past 31 / 2 years than it did in the previous three decades — because Iran does not believe that there will be consequences for its defiance.

Romney will also spend a lot of time hitting Obama on domestic policy by wrapping it in a foreign-policy veneer. Romney will make the case that you can’t have a strong military and a strong foreign policy unless you have a strong economy — and use that to hit Obama’s economic record and talk about his jobs plan. He will hit Obama for his failure to conclude a single trade agreement — and then lay out his own plan for expanding trade and U.S. exports. He will talk about the need for energy independence and highlight his plan to create energy jobs here at home. He will talk about defense sequestration and highlight both the danger to our national security and the impact on defense jobs in states such as Virginia, Florida and Ohio.

Romney also gets a second chance on Libya tonight. Look for the GOP candidate to point out that Obama failed to answer the question put to him in the last debate by undecided voter Kerry Ladka: Why were requests for additional security in Libya denied? Since Ladka asked his question, Romney can say, we have learned that Ambassador Christopher Stevens sent repeated cables warning of “an increase in attacks targeting international organizations and foreign interests,” as well as a rising al-Qaeda presence in the area, and complaining about the lack of security. Romney should say: “Mr. President, Americans deserve to know, why were those reports ignored and those requests for additional security denied? So I thought you might like to answer Kerry Ladka’s question tonight.”

This would put Obama on the defensive. He couldn’t charge Romney with politicizing the incident — because the question comes not from Romney but from an undecided voter, and Obama ducked it last time. And it also would guarantee that we will be talking about their exchange on Libya for days to come — which, unless Romney has a major gaffe, benefits him over Obama.

Bottom line: Obama cannot afford another draw. In this third and final debate, a tie goes to the challenger. Which means Obama will, in all likelihood, be going for a knockout tonight — and that means the sparks could fly.

Marc A. Thiessen, a fellow with the American Enterprise Institute, writes a weekly online column for The Post.