President Donald Trump is replacing US National Security Adviser HR McMaster with Bush-era defence hawk and former United Nations ambassador John Bolton.
Mr Trump tweeted to thank Gen McMaster, saying he had done an "outstanding job & will always remain my friend".
Mr Bolton, who has backed attacking North Korea and Iran, told Fox News his job would be to ensure the president has "the full range of options".
Gen McMaster is the latest high-profile departure from the White House.
Last week, Mr Trump fired Secretary of State Rex Tillerson by a tweet, replacing him with former CIA Director Mike Pompeo.
Mr Bolton, whose appointment does not require US Senate confirmation, will be Mr Trump's third national security adviser in 14 months. He will take the job on 9 April.
Who is John Bolton?
Mr Bolton, 69, has been a foreign policy hawk in Republican circles for decades, having served in the administrations of Ronald Reagan, George HW Bush and George W Bush.
The second Bush appointed him as US envoy to the UN, during which time diplomats privately criticised Mr Bolton's style as abrasive.
A strident neo-conservative, Mr Bolton helped build the case that Saddam Hussein possessed weapons of mass destruction, which turned out to be wrong.
Known for his walrus moustache, Mr Bolton does not appear to have greatly moderated his views since his last spell in government.
He stands by the invasion of Iraq and has advocated in newspaper op-eds using military force against North Korea and Iran.
Why is Trump replacing McMaster?
In a brief statement on Thursday, Gen McMaster thanked President Trump for appointing him and said he was applying to retire from the US Army later this year.
The 55-year-old three-star general is leaving after just over a year as national security adviser.
The White House said Mr Trump and Gen McMaster had "mutually agreed" that he would leave.He had been rumoured for weeks to be on his way out.
Gen McMaster's departure came a day after someone at the White House leaked to media that Mr Trump was advised this week in briefing documents not to congratulate Russian President Vladimir Putin on his recent re-election, but did it anyway.
White House reporter Tara McKelvey says Gen McMaster seems happy about his decision.
She says she saw him recently joking with colleagues in the West Wing, and he had already worked out his exit strategy.
The president had reportedly found Gen McMaster's briefings to be grating. He was also described as aggressive and prone to lecture.
Gen McMaster replaced Lt Gen Michael Flynn, who was fired after less than a month in the job for misleading the White House about his contacts with the Russian ambassador.