Barack Obama enters the final year of his presidency with plenty of unfinished business, from closing Guantanamo Bay to completing negotiations over the Trans-Pacific Partnership.

But Obama has already accomplished a great deal in his second term -- more than many of his critics concede and perhaps as much as any president in modern history.

In fact, the question today is not whether Obama has made real progress since 2012. The question is how much of that progress will last beyond 2017, when somebody else is in the White House.

While that’s a pretty big unknown, it wasn’t long ago that many smart observers doubted Obama would have much of a legacy to protect in the first place. His second-term efforts to get gun control legislation and then bipartisan immigration reform through Congress had failed. His bid to get congressional approval of fast-track trade authority, so that he could negotiate agreements on his own, seemed likely to meet a similar fate.

Worse still, the administration was under siege -- in Congress, in the courts, and in the media. Controversy over the killing of American personnel in Benghazi and IRS treatment of nonprofit organizations was creating the kind of turmoil that has plagued every second-term presidency since Richard Nixon’s. The fate of Obama’s signature domestic policy achievement, the Affordable Care Act, was also in doubt, thanks to a lawsuit threatening to blow away private insurance reforms in two-thirds of the states.

In short, the president looked like the quintessential lame duck.

But a lot has changed since then. Stymied in Congress, Obama has used executive authority to achieve partial versions of what he’d hoped to achieve through legislation.

He implemented far-reaching limits on greenhouse gases from power plants. He expanded dramatically the number of immigrants who can work here without threat of deportation, although the Supreme Court still has to review that action. And sometime soon -- maybe even this coming week -- Obama is likely to issue executive orders that would force more gun sellers to use background checks, in an effort to close or at least shrink what’s become known as the “gun show loophole.”

On foreign policy, Obama reopened relations with Cuba and orchestrated a multilateral agreement with Iran to halt its development of nuclear weapons. He also prevailed on fast-track trade authority. Meanwhile, Obamacare survived its court challenge, while the congressional investigations fizzled. Taxes on the wealthy went up, thanks to fiscal agreements the president made with Congress, while programs to assist the working poor got stronger.

And then, last month, came the really big news -- the announcement, in Paris, that 196 countries had signed an agreement to limit greenhouse gases in order to slow down global warming.

Obama is by no means the first modern president who made significant headway on his agenda while facing an opposition Congress in a second term.

Bill Clinton spent his final years in office fighting off personal scandal, impeachment and the (failed) attempt to remove him from office. But he still achieved a great deal -- signing fiscal agreements that helped bring the budget into balance, enacting a healthcare program that would insure several million low-income children and successfully leading a military campaign to turn back Serbia’s invasion of Kosovo.

Ronald Reagan was also highly productive during his second term, even though his administration was slogging through its own scandals. The legislative highlight of Reagan’s second term was the 1986 tax reforms, a bipartisan law that vastly simplified the federal tax code. Even today, many experts consider it a model of lawmaking at its best. On foreign policy, Reagan engineered a turnaround in relations with the Soviet Union, the country he’d famously called the “evil empire,” by reaching out to the reformist leader Mikhail Gorbachev, engaging with him diplomatically and eventually signing a major nuclear arms treaty.

How do Obama’s accomplishments stack up to the accomplishments of his predecessors? It’s a subjective question, obviously, and even experts relatively sympathetic to his agenda answer it differently.

David Greenberg, a Rutgers University historian and author of the forthcoming Republic of Spin, is among the skeptics. “Obama has done some important things since 2012,” Greenberg says, “but to say it’s been more successful than Clinton’s or Reagan’s or even Eisenhower’s isn’t plausible. Nothing he’s done rivals the peace and prosperity that prevailed when Clinton left office or the end of the Cold War.”

Obama is the most consequential second-term president since the World War II era. Larry Jacobs, University of Minnesota political scientist

Larry Jacobs, a University of Minnesota political scientist, takes nearly the opposite view. “Obama is the most consequential second term president since the World War II era,” Jacobs says. “Usually, there is a loss of energy or scandal or crisis that puts a chokehold on the White House. Obama continues to stride forward... and he's not done.” Elizabeth Borgwardt, a Washington University historian who focuses on international human rights, calls Obama’s second term “extraordinarily productive.”

But the true test of any president’s legacy is how long it lasts -- and Obama’s would appear to be particularly precarious given the strident opposition of Republicans.

The GOP presidential candidates have made repeal of the Obama agenda, via executive order or legislation, their top priority. Fulfilling those promises might not be quite as easy as the candidates make it sound. (Just ask Matt Bevin, the newly elected Republican governor of Kentucky, who is already backing off promises to opt out of Obamacare’s Medicaid expansion.) But it’s easy to imagine Ted Cruz or Marco Rubio or, yes, Donald Trump working quickly with a Republican Congress to hack away at key Obama achievements -- gutting the new limits on power plant emissions, for example, or pushing tax rates on the wealthy back down.

The other big unknown about Obama’s second term legacy is just how big a deal the Paris agreement will turn out to be. Its most enthusiastic proponents (like Jonathan Chait of New York magazine) see it as a game-changer. Although the treaty won’t stop climate change, the argument goes, it creates a process -- and expectations -- that will enable world leaders to make the progress they must in order to stave off the worst consequences of global warming. Those are obviously huge stakes.

But the Paris agreement is not binding. It basically amounts to a set of promises that world leaders might or might not honor. If major countries back out of those promises, then the agreement will mean little and the planet will continue to cook, just as it is now. Of course, the country most likely to pull out of Paris is the U.S., because it’s the only country with a major opposition party that denies the significance -- and even the existence -- of man-made climate change.

Obama understands this. He knows that the ultimate impact of the Paris agreement -- like so many of his second term achievements -- will vary enormously depending on who succeeds him. That’s one reason he intends to campaign so aggressively for the Democratic presidential nominee.

The name on the ballot in November will probably be Hillary Clinton, or maybe Bernie Sanders. But the legacy will be Obama’s.

Also on HuffPost:

PHOTO GALLERY Obama's Fist Bumps