A White House official said Trump and McMaster had been discussing the latter's departure "for some time" and they mutually agreed to the move.
"The timeline was expedited as they both felt it was important to have the new team in place, instead of constant speculation. This was not related to any one moment or incident, rather it was the result of ongoing conversations between the two," the official said.
McMaster was expected to remain as national security adviser through mid-April in order to assure a smooth transition of leadership.
Trump praised McMaster for his three decades of service to the country.
"He has won many battles and his bravery and toughness are legendary," the president said. "General McMaster's leadership of the National Security Council staff has helped my administration accomplish great things to bolster America's national security."
Along with his resignation from the White House post, McMaster plans to retire from the U.S. Army after 34 years of service.
"Throughout my career it has been my greatest privilege to serve alongside extraordinary servicemembers and dedicated civilians," McMaster said. "I am especially proud to have served alongside the men and women of the National Security Council staff who established a strong foundation for protecting the American people, promoting American prosperity, achieving peace through strength, and advancing American influence."
Prior to joining Trump's White House, Bolton served as the U.S. permanent representative to the United Nations from 2005-06 and undersecretary of state for arms control and international security from 2001-05.