Mr Trump said: "The country is doing very well, strongest stock market ever, and I think the general will add to it. He's going to do a really great job."

However, Mr Kelly's ability to bring the White House under control will largely depend on how much authority Mr Trump gives him to take charge, and whether he will be able to control the president's use of social media.

Corey Lewandowski, Mr Trump's former campaign manager, said he expected Mr Kelly to "restore order to the staff" but that the president would not change.

He said: "I say you have to let Trump be Trump. That is what has made him successful over the last 30 years. That is what the American people voted for. Anybody who thinks they're going to change Donald Trump doesn't know Donald Trump."

Mr Kelly was sworn in by Mr Trump at a private ceremony. The president told reporters: "We look forward to — if it’s possible — an even better job as chief of staff.”

The president was said to have been impressed by his commitment to carrying out his immigration policies while at Homeland Security. His in-tray will include dealing with multiple investigations into any links between the Trump campaign and Russia and a stalled legislative agenda.

He will also have to deal with rivalries within the White House and the outspoken new communications chief Anthony Scaramucci.