U.S. President Donald Trump said Thursday he will replace his national security adviser H.R. McMaster with John Bolton, a former U.S. ambassador to the United Nations.

Trump said in a Twitter post that Bolton, known as a hardliner on North Korea and Iran, will take over on April 9 ahead of a planned meeting between Trump and North Korean leader Kim Jong Un in May in a bid to achieve "permanent denuclearization" of the Korean Peninsula.

(H. R. McMaster, UPI/Kyodo)

McMaster's departure follows Trump's dismissal of Secretary of State Rex Tillerson last week.

Trump and McMaster have been discussing the three-star Army general's departure "for some time," but decided to expedite the timing as they "both felt it was important to have the new team in place, instead of constant speculation," a White House official said.

"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 wanted to fill out his national security team before his meeting with Kim, the first-ever summit between the two countries, which do not have diplomatic relations, the New York Times reported, quoting White House officials.

Mike Pompeo, the Central Intelligence Agency director who is Trump's nominee for the next secretary of state, is expected to be sworn in after undergoing a Senate confirmation hearing scheduled for April.

Bolton will be the third national security adviser for Trump since the launch of his administration in January 2017.

He was the U.S. ambassador to the United Nations from 2005 to 2006 after serving as undersecretary of state for arms control and international security from 2001 to 2005.