McMaster is a highly regarded military tactician and strategic thinker, but his selection surprised some observers who wondered how the officer, whose Army career stalled at times for his questioning of authority, would deal with a White House that has not welcomed criticism.
"He is highly respected by everybody in the military and we're very honored to have him," Trump told reporters in West Palm Beach where he spent the weekend. "He's a man of tremendous talent and tremendous experience."
One subject on which Trump and McMaster could soon differ is Russia. McMaster shares the consensus view among the US national security establishment that Russia is a threat and an antagonist to the United States, while the man whom McMaster is replacing, retired Lt. Gen. Michael Flynn, appeared to view it more as a potential geopolitical partner.
Flynn was fired as national security adviser on Feb. 13 after reports emerged he had misled Vice President Mike Pence about speaking to Russia's ambassador to the United States about US sanctions before Trump's inauguration.
Trump also named Keith Kellogg, a retired US Army general who has been serving as the acting national security adviser, as chief of staff to the National Security Council. John Bolton, a former US ambassador to the United Nations, will serve the administration in another capacity, Trump said.
The national security adviser is an independent aide to the president and does not require confirmation by the US Senate. The role has varied from administration to administration, but the adviser attends National Security Council meetings along with the heads of the State Department, the Department of Defense and key security agencies.
McMaster, 54, is a West Point graduate known as "H.R.," with a Ph.D. in US history from the University of North Carolina at Chapel Hill. He was listed as one of Time magazine's 100 most influential people in 2014, partly because of his willingness to buck the system.
A combat veteran, he gained renown in the first Gulf War - and was awarded a Silver Star - after he commanded a small troop of the U.S. 2nd Army Cavalry Regiment that destroyed a much larger Iraqi Republican Guard force in 1991 in a place called 73 Easting, for its map coordinates, in what many consider the biggest tank battle since World War Two.
As one fellow officer put it, referring to Trump's inner circle of aides and speaking on condition of anonymity, the Trump White House "has its own Republican Guard, which may be harder for him to deal with than the Iraqis were."