Trump made the announcement on Monday after meeting with McMaster and other military officials at his Mar-a-Lago estate in Palm Beach, Florida. "He is highly respected by everybody in the military and we're very honored to have him," the president said during a brief three-minute appearance with journalists.
McMaster said he was grateful for the opportunity serve in the role. "I look forward to joining the national security team and doing everything I can to advance and protect the interests of the American people," he said.
Lawmakers were quick to welcome his appointment.
"General H.R. McMaster is tremendously respected and admired as someone who is willing to look at things afresh and to make changes where needed," Rep. William "Mac" Thornberry, a Republican from Texas and chairman of the House Armed Services Committee, said in a statement. "He has the ability to make an outstanding National Security Advisor."
McMaster is known as a strategic thinker within the U.S. military who most recently served as director of the Army Capabilities Integration Center and deputy commanding general at U.S. Army Training and Doctrine Command, based at Joint Base Langley-Eustis in Virginia.
A West Point graduate who climbed the ranks to command troops during the Gulf War and the U.S.-led wars in Iraq and Afghanistan, McMaster received a doctorate degree in military history from the University of North Carolina.
As a three-star general, McMaster has spent a significant amount of time studying weapons and the future of warfare. For example, he has backed using the Army's new Joint Light Tactical Vehicle for reconnaissance missions by modifying it to carry more soldiers and arming it with a 30mm chaingun.
McMaster has also studied policy and wrote about the missteps the U.S. made during the Vietnam War. He's the author of the 1997 book, "Dereliction of Duty: Lyndon Johnson, Robert McNamara, The Joint Chiefs of Staff, and the Lies that Led to Vietnam."
In addition to McMaster, Trump also met over the weekend with his acting adviser, retired Army Lt. Gen. Keith Kellogg; John Bolton, a former U.S. ambassador to the United Nations; and Army Lt. Gen. Robert Caslen, the superintendent of the U.S. Military Academy at West Point, according to the Associated Press and White House pool reports.
"Meeting with Generals at Mar-a-Lago in Florida," Trump tweeted earlier Monday. "Very interesting!"
Flynn, a retired Army lieutenant general and the former director of the Defense Intelligence Agency, a week ago resigned at the direction of Trump over allegations that he lied to Vice President Mike Pence about whether he discussed sanctions with the Russian ambassador to the U.S., Sergey Kislyak, prior to taking office.
Speaking in Brussels on Monday, Pence said he was disappointed to learn that Flynn presented him with inaccurate information. The vice president also sought to reassure NATO allies by pledging to work with the alliance on security matters.