"I am pleased to announce that, effective 4/9/18, @AmbJohnBolton will be my new National Security Advisor," Trump said in a tweet.
"I am very thankful for the service of General H.R. McMaster who has done an outstanding job & will always remain my friend. There will be an official contact handover on 4/9."
McMaster had been expected to leave later this year, but Bolton's nomination shocked Washington.
A vocal advocate of the Iraq war, he has also advocated preemptive strikes against North Korea and war with Iran.
Lawsuit filed after Malaysian flag mistaken for defaced US flag with Islamic State symbols
His appointment had been fiercely opposed by many within Trump's inner circle, most notably the coterie of military officers who have experienced the brutality of war first hand.
McMaster, a three star army general, had been expected to move out of the White House and into a four star position.
Instead he will retire from public life.
"After thirty-four years of service to our nation, I am requesting retirement from the US Army effective this summer after which I will leave public service," he said in a statement.
"Throughout my career it has been my greatest privilege to serve alongside extraordinary service members and dedicated civilians."
His departure comes as Trump faces a high stakes meeting with North Korean leader Kim Jong Un and weighs the future of a deal to curb Iran's nuclear weapons, which now appears to be in grave peril.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ