Much of Donald Trump's inaugural speech was written by Steve Bannon and Stephen Miller, two of the president's controversial key advisers, a White House official has said.

As the world stood still to watch the handover of power from Barack Obama to the 45th president of the US, Trump delivered a speech echoing nationalist sentiments to set the tone for his presidency.

According to a Wall Street Journal (WSJ) analysis of the US leader's language, about 58% of his speech contained nationalist themes.

Trump appeared to paint himself as a redeemer to a bleak country that has been robbed of "so much unrealised potential" and vowed to transfer power from the halls of Washington DC to "the people".

Speaking from the steps of the Capitol, he declared: "This American carnage stops right here and stops right now."

In fact, so dreary was Trump's outlook that one Twitter user even posted a video on the microblogging platform highlighting its similarity to a speech from supervillain Bane in The Dark Knight Rises.

Robert Dallek, an American historian who specialises in US presidents, told the Wall Street Journal that incoming leaders usually focus on providing a message of shared purpose and national reconciliation. Trump's speech, however, "had no hint of that".

Dallek added: "Listening to him, you'd think the country was in the midst of some terrible depression and besieged on all sides. Barack Obama isn't leaving the country in a golden moment, but it was quite overstated."

While Bannon lauded Trump's speech as "an unvarnished declaration of the basic principles of his populist and nationalist movement" with a "deep, deep root of patriotism", others characterised it as "angry" as the Republican promised to start "winning again".

"It was a very Trumpian speech, aggressive more than ironic, an address that will thrill his supporters and worry his critics," said Peter Wehner, who worked in the last three Republican administrations. "He promised us not just a better America, but a nearly perfect America. He will now be held to those promises, those expectations, those commitments," he added.

Trump appointed Steve Bannon as a chief strategist and Senior Counselor during his presidential campaign. Bannon temporarily stood down from his role as executive chair of Brietbart.

The US civil rights group the Southern Poverty Law Centre describes Steve Bannon as having "a long history of bigotry" and who oversaw the right-wing website Breitbart "into the media arm of the racist Alternative-Right movement" as its executive chair.