If President Obama wants to find solace from American history, he might look to the 1938 midterm elections. The Republicans, benefitting from disgust with Franklin Roosevelt’s court-packing scheme and another economic downturn, picked up eight Senate seats, 81 House seats and 13 governorships. The Democrats maintained a formal congressional majority, but a not real one, as many conservative southern Democrats opposed Roosevelt and the New Deal.

But the political coalition he lost for his domestic agenda, Roosevelt eventually recouped through his foreign policy—eventually dying in office and becoming renowned in history as his nation’s leader in “The Good War.” That option—emerging as a widely beloved “total war” leader is not open to Obama. But making a big mark in foreign policy is—and remains the only route redeem his presidency.

On Election Day, the Washington Post published a useful effort to explain the decline in Obama’s popularity from his re-election in 2012 to the midterms. To those who aren’t political junkies, the collapse is a bit of a mystery, as the president is pretty much the same man as the one who defeated a quite capable Mitt Romney two years ago. By then he had long been stripped any magical “hope and change” properties voters might have ascribed to him in 2008. Instead he campaigned with his limitations known: a good orator, not especially deft at managing the power levers of the presidency, reluctant to pick fights, insular in his choice of advisors, moderate, and prone to compromise. A liberal Republican perhaps, in a multicultural, third-worldist packaging?

In the Post’s telling, small events piled up to undermine Obama’s authority in the last two years: an ultimately futile effort to get a gun control bill passed after a horrific school shooting; the botched website on the Obamacare rollout; the crisis of the border crossing children; Ukraine; Ebola. Of these, I would argue that only Ukraine was truly bad presidential policy, a result of leaving neocons in charge of the State Department’s European desk, who then proceeded to foment a coup d’etat in Kiev without considering Moscow’s reaction. But the lesser missteps created the impression of an unsteady hand on the tiller.

Yet the Washington Post story skips over the most important initiative in Obama’s second term. Obama has pursued, carefully and methodically, an Iran detente, a course impossible while Ahmadinejad was president and Iran was imprisoning Green Movement leaders. But once it became possible, Obama and his diplomats advanced forcefully, forging at least in outline an arrangement that would limit Iranian enrichment and open the country to international inspections in exchange for a loosening of the sanctions imposed on Iran for nearly a decade.

The negotiation is technical and complex, and the deadline—extended once for six months, looms in less then three weeks. Both the P5+1 powers (the U.S., France, Britain, China, Russia, and Germany) and Iran are maneuvering hard for an advantage—either concerning the provisions of the final deal, or possibly for the high ground in placing blame if the negotiations fail. It is not known whether Iran has now or ever did have a policy of seeking nuclear weapons: the Iranians deny it, claiming that weapons of mass destruction are contrary to Islam, and they did not develop chemical weapons even while they were being assaulted heavily with Iraqi chemical agents during the Iran-Iraq war. American intelligence agencies don’t think that Iran seeks a bomb. It has been noted that the countries most loudly accusatory about the Iranian nuclear program (Israel and the United States) are themselves nuclear-armed states with a record of attacking Muslim countries. Presumably their strategists assume that, given the threats it faces, it would make sense for Iran to develop a nuclear weapons deterrent.

Complicating the negotiation is Congress, which contains a powerful claque which views all international developments through the prism of what it perceives as good for Israel. Israel has made clear its opposition to any arrangement that permits Iran an active nuclear industry, whether or not it develops weapons. The administration has made clear that if it reaches a deal with Iran, it will not seek Congressional approval, which would probably not be forthcoming. The American sanctions on Iran are backed by legislation passed by Congress, but they include a provision allowing the President to waive them. The Iranians naturally worry that if sanctions are “waived” rather than terminated, a more hawkish or Israel-centric president would simply re-impose them.

If a deal that constrains but does not terminate Iran’s nuclear industry is arrived at, the battle between Obama and Congress, or more precisely, between Obama and the Israel lobby and its backers in Congress, will likely emerge as the centerpiece of the final two years of his presidency. It is likely to loom larger in significance than any foreign policy battle between president and Congress in the postwar era; to find a parallel, one might have to return to FDR’s effort to outmaneuver a hostile and generally isolationist Congress in order to support Britain and eventually enter World War II. In that battle, as this one, Congress held many of the cards: the neutrality acts passed in the 1930s genuinely constrained Roosevelt, and public opinion was initially heavily on the side of Congress’s isolationists.

A major distinction of course is that FDR was trying to maneuver the country into war with Germany, while Obama seeks a peaceful detente, and possibly even a de facto alliance with Iran. But the significant parallel that Obama can take solace from is that in both cases the international climate shifted rapidly to provide a tailwind for the President. Roosevelt had to combat the perception (reasonable enough) that the oceans provided America ample security from Europe’s wars, and Asia’s as well. But that perception grew weaker once Hitler broke the bounds of Munich, and then in 1940 invaded France and the low countries. American public opinion in early 1941 was far more open to intervention than it had been two years earlier.

In the case of Iran, much has changed since Congress imposed sanctions. First of all Iran has changed, or partially changed, its leadership. President Rouhani—elected in a vote that was free and competitive by Mideastern standards, is not, like his predecessor, a belligerent who plays footsie with Holocaust deniers. He clearly rode the vast wave of young educated Iranian opinion that wants an end to the country’s isolation, and seeks a rapprochement with America. That doesn’t mean submission to American demands—and Rouhani’s political leash from a conservative Iranian parliament and the country’s Supreme Leader Khamenei may be shorter than Obama’s. But he certainly represents an Iran that wants to turn the page.

Secondly, even the initial agreement signed last November has opened up Iran to some Western journalists, who are bringing reports of a young, urban Iran, which seems attractive, interesting, and latently quite friendly to the United States. This was communicated clearly in Steve Kroft’s visit for CBS’s “60 Minutes” last spring, and perhaps even more so in Anthony Bourdain’s recent visit. Bourdain is a roving food and travel writer, his Parts Unknown show seen by more than half a million viewers: it would be difficult for anyone who viewed the hour-long program on Iran to think of the country as an enemy.

Thirdly, the rise of the Sunni extremist group ISIS has demonstrated how thin and unreliable America’s existing alliance structure is in the Mideast. While ISIS is a small, underarmed force, its success in seizing territory rapidly revealed how few Sunni states really oppose Islamic extremism. Saudi pilots have refused orders to bomb ISIS forces—which speaks volumes about the hearts and minds inside the kingdom. Turkey opposes its own Kurdish population more than it does Sunni extremists. One expects, or at least must hope, that Sunni opinion will evolve and become more resistant to ISIS fanaticism. But until and probably after then, Iran looks awfully good by comparison.

Fourth, Israel has been losing influence as an ally, if not decisively in Washington, then certainly among America’s partners in imposing Iran sanctions. Americans may have shrugged off Israel’s assault on civilian targets in Gaza, but Europe, where Israel’s policies towards the Palestinians are viewed increasingly with repugnance, has not. The continent is moving inexorably towards recognizing Palestinian statehood, ignoring Washington’s constant admonishments not to. Britain’s Parliamentary vote to recognize Palestine was a landmark in evolving opinion, and will inevitably be followed by comparable moves in France and even guilt-ridden Germany. Israel’s ability to hector, persuade, or guilt-trip Europeans into supporting its policies, whether anti-Palestinian or anti-Iran, is approaching its sell-by date.

Finally, America’s technical ability to impose sanctions and have them followed by the P5+1 is slowly disappearing. The sanctions regime depends on Washington’s ability to monitor and punish dollar-denominated transactions with Iran. But Russia and China have already initiated barter agreements with Tehran, and European businesses are chafing to enter Tehran’s markets. If Washington tries to keep the sanctions on, or ratchet them up, as the Congress’s Israel faction demands, it may one day find itself brandishing a very wet noodle.

There is little doubt that if Obama reaches a deal, Israel and its advocates will be able to generate a seemingly massive Congressional uproar to undermine the President’s diplomacy. But larger forces, both inside and beyond the Beltway, line up on Obama’s side. The Pentagon, it was reported recently, has been seeking to make deals with Iranian companies in order to stabilize Afghanistan. Will the U.S. military brass, having expended large amounts of blood and treasure to wrest Afghanistan from the Taliban, wish to see it revert to Islamic extremism because Israel doesn’t want Iran involved in stabilizing the country?

Maneuvering for an Iran deal will take all the political acumen Obama can muster, and more than he has demonstrated in previous dealings with Congress. And in terms of political skill and appeal, Obama is no Franklin D. Roosevelt. But the president has powerful cards to play, and will have the support of much of the world if he plays them well. One day peace with Iran may seem as inevitable as did war with Germany. Even though he was drubbed in the midterms, Obama’s chance to forge an historic and positive legacy still lies very much before him.

Scott McConnell is a founding editor of The American Conservative.