Mr Trump called Lieutenant General McMaster “a man of tremendous talent and tremendous experience” after announcing the decision from his Florida Mar-a-Lago resort, the so-called Winter White House.
The president said Keith Kellogg, the president’s acting national adviser and a supporter of Mr Trump since his campaign, would stay on at the National Security Council as chief of staff.
Both Lt Gen McMaster and Mr Kellogg joined Mr Trump in Florida for the official announcement.
“I would just like to say what a privilege it is to be able to continue serving our nation,” Lt Gen McMaster said. “I’m grateful to you for that opportunity, and I look forward to joining the national security team and doing everything that I can to advance and protect the interests of the American people.”
Mr Trump said of Lt Gen McMaster: “He’s a man of tremendous talent and tremendous experience. I watched and read a lot over the last two days. He is highly respected by everyone in the military and we’re very honoured to have him.”
The appointment of Lt Gen McMaster caps the end of a tumultuous week in the White House after the sudden removal of Mr Flynn amid questions over the former general’s ties to Russia and his misrepresentation of phone calls he had with the Russian ambassador before the administration had taken office.
Mr Trump’s first choice to replace Mr Flynn, Robert Harward, a retired admiral, turned down the president amid concerns that he would not be able to hire his own staff.
In addition to Lt Gen McMaster, Mr Trump had also been considering Mr Kellogg to fill the position, as well as John Bolton, the former US ambassador to the UN under George W Bush.
On Monday Mr Trump announced that Mr Bolton, though not taking on the top role at the National Security Council, would still be working with the White House, albeit “in a somewhat different capacity”.
Lt Gen McMaster, 54, is the director of the Army Capabilities Integration Center and a highly regarded military veteran with experience in Iraq and Afghanistan.
A graduate of West Point, he served as senior adviser to General David Petraeus during the Iraq war. In 2014, Time Magazine named the lieutenant general as one of the world’s 100 most influential people, calling him a “pre-eminent warrior-thinker” and “the architect of the future US army”.
He also was praised for his 1997 book Dereliction of Duty, which explored the failings of US military leaders during the Vietnam war.
Lt Gen McMaster is one of several generals serving in Mr Trump’s cabinet. James Mattis, Mr Trump’s defence secretary, is the former commander of US Central Command, while John Kelly, Mr Trump’s director of homeland security, is a retired four-star marine corps general.
It was not immediately clear whether Mr Flynn’s deputies at the NSC would be staying on or whether Lt Gen McMaster would be allowed to hire his own staff — a point of contention for some candidates under consideration for the role.
John McCain, the Republican senator and chair of the Senate’s armed services committee, praised Lt Gen McMaster’s appointment.
“Lt Gen HR McMaster is an outstanding choice for national security adviser,” he said in a statement. “I have had the honour of knowing him for many years, and he is a man of genuine intellect, character and ability.”
Sample the FT’s top stories for a week
You select the topic, we deliver the news.