President Trump announced Thursday that White House national security adviser H.R. McMaster would be replaced in April by former U.N. ambassador John Bolton.

In a tweet, Trump said he was “very thankful” to McMaster for his service, adding that he “has done an outstanding job & will always remain my friend.”

The president’s announcement comes after months of speculation over whether McMaster would resign or be fired from his post. Now Bolton, who has served as a Fox News contributor, will take over the position on April 9.

“Throughout my career it has been my greatest privilege to serve alongside extraordinary service members and dedicated civilians,” McMaster said in a statement. He went on to thank the president “for the opportunity to serve.”

“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,” McMaster continued. “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. I know that these patriots will continue to serve our President and our nation with distinction.”

McMaster's ouster sparked a series of reactions. Here's what is being said:

Vice President Mike Pence tweeted that McMaster leaves the position "w/ our highest respect for his service to this Admin & his heroic service on & off the battlefield."

He also congratulated Bolton, "a highly respected American patriot," to the position.

White House Chief of Staff John Kelly labeled McMaster "a fine American and military officer" who "served with distinction and honor throughout his career in the U.S. Army and as the National Security Advisor."

Kelly continued: “He brought and maintained discipline and energy to our vital interagency process. He helped develop options for the President and ensured that those options were presented fully and fairly. A true solider-scholar, his impact on his country and this government will be felt for years to come.”

In a tweet, Florida Sen. Marco Rubio called Bolton “an excellent choice who will do a great job.”

Current UN ambassador Nikki Haley thanked McMaster for his “service and loyalty,” adding in the tweet, “Your selfless courage and leadership has inspired all of us.”

Sen. Bob Corker, R-Tenn., tweeted that "it has been a privilege to work with" McMaster.

Arkansas Sen. Tom Cotton in a statement called McMaster "a warrior and a scholar, one of the best generals of his generation."

"I join all Arkansans in thanking him for decades of service to our nation, most recently as President Trump's National Security Advisor," Cotton continued. "I also congratulate Ambassador John Bolton for his appointment as the next National Security Advisor. He's an excellent choice to take the baton from General McMaster."

In a tweet, Rep. Lee Zeldin, R-N.Y. called Bolton "ridiculously knowledgable" and said he would be a "great National Security Adviser" for Trump.

But McMaster's replacement by Bolton was also met by a series of criticisms. Sen. Bernie Sanders, D-Vt., slammed Bolton in a tweet saying "he was too extreme to be confirmed as UN ambassador in 2005 and is absolutely the wrong person to be national security advisor now."

Sen. Chuck Schumer, D-N.Y. in said on Twitter that Bolton's "tendency to try to solve every geopolitical problem with the American military first is a troubling one."

Minnesota U.S. Rep. Betty McCollum also disagreed with the decision to move Bolton into the position, tweeting that the former U.N. ambassador was "a discredited architect of the Iraq War" and his "appointment puts our national security at risk."

Sen. Chris Coons, D-Del., thanked McMaster for his service but said in a statement that he was "concerned that President Trump has chosen to abruptly dismiss" him and "hire his third national security advisor in just 15 months."

"Though Ambassador John Bolton has extensive foreign policy experience, I'm deeply concerned by the prospect of him advising President Trump and directing key debates on national security policy," Coons said.

"Ambassador Bolton's stated positions on today's major issues, most notably North Korea's and Iran's nuclear programs, are overly aggressive at best and downright dangerous at worst," he continued. "I hope that Ambassador Bolton will moderate his positions and work closely with our military, diplomatic, intelligence, and development professionals before rushing into armed conflict."

Virginia Rep. Don Beyer called the move on Twitter "a monumental step backward."

Fox News' Brooke Singman and Kristin Brown contributed to this report.