Barack Obama delivered his farewell speech to a tearful crowd to mark the end of his eight-year presidency.

In the 52-minute address, the outgoing president spoke of his legacy and repeated calls for unity in a climate of increasing political division.

However, arguably his most powerful message was a thinly-veiled attack on the “blue-collar billionaire”, and President-elect Donald Trump’s populist campaign rhetoric, which seized on white working-class dissatisfaction in America’s rust belt.

“If every economic issue is framed as a struggle between a hard-working white middle class and undeserving minorities, then workers of all shades will be left fighting for scraps while the wealthy withdraw further into their private enclaves,” he said.

Many accredit the success of Mr Trump’s campaign to his ability to tap into anger over industrial decline and diminishing prospects, vilifying minorities and causing a backlash against establishment forces.

But Mr Obama warned against politics of division, and called for unity in the face of growing wealth disparity.

The President also spoke out against the polarisation of ideals, making citizens susceptible to fake news and propaganda.

“In the rise of naked partisanship and increasing economic and regional stratification, the splintering of our media into a channel for every taste, all this makes this great sorting seem natural, even inevitable,” he said.

“And increasingly, we become so secure in our bubbles that we start accepting only information, whether it’s true or not, that fits our opinions, instead of basing our opinions on evidence that is out there.”

He also used the opportunity to acknowledge the persistence of racial tensions in the US, despite many believing America had arrived in a post-racial era after he was elected to office.

“After my election there was talk of a post-racial America. And such a vision, however well intended, was never realistic. Race remains a potent and often divisive force in our society,” he said.