Gregory Korte

USA TODAY

WASHINGTON — Donald Trump's stunning victory Tuesday was nothing less than a repudiation of the Obama presidency.

"Elections have consequences," as President Obama himself said after his 2008 win. And for Obama, it's hard to imagine a more consequential outcome Tuesday night.

With Republicans maintaining control of the House and Senate, President-elect Trump would be in a position to repeal large parts of Obama's legislative agenda, repeal his executive orders with a stroke of a pen, and install conservative Supreme Court justices.

Consider the opposite scenario: Clinton's election would have ushered in a new era of American politics: The Obama era. With his former secretary of State in the White House, Obama would be able to count on on a successor who will pursue some of his most transformative and controversial policies: immigration reform, the expansion of health care and environmental regulation.

Trump has pledged to repeal every one of them.

Trump's election represents a "hostile takeover" of the White House, upending the political order with a new brand of politics that doesn't neatly fit into the existing bipartisan framework, said Curt Nichols, a political science professor at Baylor University who has studied how presidential elections affect the reordering of American politics.

Judging from his whirlwind campaigning of the past few weeks, no one was more aware of Trump's threat to his legacy than Obama himself. He recited a litany of accomplishments — from the auto industry rescue to the Affordable Care Act to the Paris climate accords.

"All the progress we’ve made goes out the window if we don’t win this election," he said in stump speeches in Ohio, North Carolina and Florida — states Trump won by appealing to largely voters disaffected by the economic disruption of the last decade. "Let's go finish what we started."

Trump's win puts more urgency into Obama's lame-duck presidency, as Obama will now have to redouble his efforts to solidify his agenda. The Trans-Pacific Partnership must pass on his watch, or not at all. With criminal justice reform less likely, he could resort even more to his power to pardon and commute sentences.

How did pollsters get Trump, Clinton election so wrong?

Elections 2016 | USA TODAY Network

Regardless of how it ends, Obama has accomplished something that history cannot take away: He is the first African-American president — and a two-term president at that. But his reliance on executive action in the final years of his presidency makes many of his accomplishments easily erased. Historians will debate whether Obama could have done more establish a more permanent legacy, or whether he was the victim of forces beyond his control.

"With this loss, President Obama loses the opportunity to go down as one of America's great presidents," Nichols said. "It looks like Obama has failed to exploit his opportunity to be a transformation president."