President Donald Trump announced on Thursday that he is appointing Amb. John Bolton as his new national security advisor, ending weeks of speculation he would be tapped for the job.

Trump made the announcement via Twitter:

I am pleased to announce that, effective 4/9/18, @AmbJohnBolton will be my new National Security Advisor. 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. — Donald J. Trump (@realDonaldTrump) March 22, 2018

Bolton’s appointment comes after months of speculation that current National Security Advisor H.R. McMaster was on his way out, after repeated reports that he and the president were not close. It also comes after someone leaked to the press that the president congratulated Putin on his election win after a briefing card had included the note: DO NOT CONGRATULATE.

According to a White House official, the president and McMaster had “mutually agreed” on his resignation, and the two had been discussing it for “some time.” However, 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. Trump announced last week that Secretary of State Rex Tillerson was resigning, and CIA Director Mike Pompeo would take his place.

McMaster, a lieutenant general, said in a statement that he is requesting retirement from the Army, and will leave public service.

“I am thankful to President Donald J. Trump for the opportunity to serve him and our nation as national security advisor. I am grateful for the friendship and support of the members of the National Security Council who worked together to provide the President with the best options to protect and advance our national interests,” he said.

Trump praised McMaster in a statement.

“H.R. McMaster has served his country with distinction for more than 30 years. He has won many battles and his bravery and toughness are legendary. General McMaster’s leadership of the National Security Council staff has helped my administration accomplish great things to bolster America’s national security. He helped develop our America First National Security Strategy, revitalize our alliances in the Middle East, smash ISIS, bring North Korea to the table, and strengthen our nation’s prosperity. This work and those achievements will ensure that America builds on its economic and military advantages. I thank General McMaster and his family for their service and wish them the very best.”

White House Chief of Staff John Kelly called McMaster a “true soldier-scholar.”

“His impact on his country and this government will be felt for years to come,” he said.

Bolton was spotted entering the West Wing late Thursday afternoon:

John Bolton spotted entering the West Wing pic.twitter.com/KBJCPgYOak — Charlie Spiering (@charliespiering) March 22, 2018

Bolton last served in the George W. Bush administration as the U.S. Ambassador to the United Nations. Bolton is a senior fellow at the conservative American Enterprise Institute and a frequent Fox News commentator. He has also been a regular guest on Breitbart News Daily.

He spoke with Breitbart News Daily on Thursday morning, discussing the Trump administration’s actions against unfair trade practices by China.