The legacy of a US president is inevitably overshadowed by their successor and in Barack Obama’s case Donald Trump campaigned with a promise to wipe his predecessor’s name from the history books.

Many of Obama’s landmark achievements in office can be unravelled by Trump, from the deal to curb Iran’s nuclear programme and the reopening of economic and diplomatic relations with Cuba to the Paris climate change agreement and the extension of health insurance to millions under the Affordable Care Act.

Trump’s victory marked such a pendulum swing in US politics that with Republicans stronger than they have been since 1928, controlling both houses of Congress and a large majority of governorships and state legislatures, that pendulum can be turned into a wrecking ball to Obama’s fragile political legacy.

The historic election of the first black president, the son of a Kenyan man and Kansas woman, will guarantee Obama a mention in every textbook on the history of the republic. That achievement alone will stand above all others from the Obama era. He made it normal for a black man to hold the highest office, breaking a mould more than 40 years after the civil rights movement. That he did so with so such dignity, grace and integrity in a scandal-free White House will put him among the country’s most respected presidents.

His legislative legacy is far more uneven. Taking office with hopes to emulate Franklin D Roosevelt’s New Deal or Lyndon Baines Johnson’s Great Society with a progressive reforms, he hit a congressional brick wall. Obama’s remarkable ability to stir the public’s deepest aspirations on the campaign trail became stuck in the political mud of hyper-partisanship and the paralytic design of the American government.

Post-racial united country

His keynote address at the 2004 Democratic National Convention, the speech that catapulted him onto the national stage when he spoke about a post-racial united country, quickly faded. He viewed the country being more than just a “collection of red states and blue states” but his message of “hope and change” lost strength in the poisoned atmosphere of Washington politics. Disunity reigned.

Almost all of the significant legislation passed during the Obama years was signed in his first two years when his Democratic Party controlled both the US Senate and House of Representatives.

In early 2009, during the first weeks of his presidency, Obama helped prevent the worst economic crash in almost a century descending into a second Great Depression with a series of politically difficult decisions. But it came with fierce Republican opposition. The new Democratic majority in Congress passed a stimulus bill that jump-started the economy. Bailouts of the motor industry and, controversially, the financial industry, without demands for banker resignations, angered progressives but saved the economy from collapse.

The main legislative accomplishments of those early Obama years – the Dodd-Frank financial regulations and Obamacare – will be the first to come under attack during the Trump administration. Designed to prevent a financial crisis from toppling the economy, the sweeping Dodd-Frank reforms of Wall Street and the banking sector are firmly in the crosshairs of a Trump White House intent on deregulating.

Great political cost

The passage of Obamacare, the household name for the Affordable Care Act, gave millions of uninsured Americans healthcare coverage but came at great political cost for the Democratic president. Republicans were angered that Obama and his Democratic allies on Capitol Hill acted unilaterally to pass a law that they believed put undue burdens on government, business and individuals.

The party’s senate leader Mitch McConnell set out a clear Republican objective: make Obama a one-term president. After his re-election, governance crumbled under the weight of obstructionism

Divisions led to severe gridlock and the political capital spent on the protracted fight to pass and defend Obamacare left little in the bank for Obama’s energy and environmental legislation, immigration, gun control or further stimulus measures to strengthen the economic recovery.

The rise of the Tea Party and the attacks on the legitimacy of his presidency, which questioned whether he was born in the US, helped Republicans win back the House in 2010 and the Senate in 2014, and ultimately helped paved the way for Donald Trump’s insurgent candidacy.

Facing such roadblocks, Obama had to bypass Congress and resort to far-reaching executive actions to push through his policies. These can be easily overturned with the stroke of Trump’s pen, though the new president has said that he may retain the popular parts of Obama’s healthcare law.

Islamic State

Obama’s foreign policy legacy is as mixed as domestic record. He adopted a doctrine of conditional, limited intervention, failing to fulfill completely his promise to withdraw America’s presence from Iraq and Afghanistan. He failed to close the Guantanamo prison camp as promised, underestimated the threat posed by Islamic State and vacillated on whether to intervene in the Syria conflict over the Assad regime’s use of chemical weapons, a move his critics said emboldened Russian and Chinese expansionism. The situation in Syria “haunts” him, he has said, but at the same time he said there was not much he could have done differently.

Obama (55) has said that one of the few regrets of his presidency was that the rancour and suspicions between the two political parties had become worse, not better. That his farewell address in Chicago earlier this month was littered with references to warnings about the threats to democracy and the risks of deep political divisions illustrated the unfinished business he leaves behind, particularly in race relations. For the first time since the 1980s, the presidential cabinet picked by Trump (70) contains no Democrats or Latinos.

As the 44th president hands over to the 45th president with no political or military leadership experience after his chosen successor was rejected in a bruising election, Obama can at least look to his 60 per cent-plus approval rating (and Trump’s 40 per cent) for signs of how he might be remembered, even if opinions of his accomplishments are mixed and break along party lines.