As tensions mounted between President Donald Trump and his third national security adviser, John Bolton, Trump reportedly began calling his second national security adviser, Lt. Gen. H.R. McMaster, for advice.

NBC News reported that Trump also told McMaster he missed him.

The outreach to McMaster apparently came as a surprise to those closest to Trump, but the president has a history of reaching out to an aide's predecessor when he's displeased with that aide.

Trump abruptly fired Bolton via tweet on Tuesday. He said he would name a new national security adviser next week.

Visit Business Insider's homepage for more stories.

As tensions between President Donald Trump and his third national security adviser were mounting, Trump began calling his second national security adviser and telling him he missed him, NBC News reported Tuesday.

Lt. Gen. H.R. McMaster was abruptly ousted in March 2018 and replaced with John Bolton. But as Trump began losing confidence in Bolton, he started calling McMaster and asking for his advice on national security issues like whom he should nominate to lead the Pentagon, NBC News reported.

Trump announced Bolton's dismissal on Twitter on Tuesday, writing: "I informed John Bolton last night that his services are no longer needed at the White House. I disagreed strongly with many of his suggestions, as did others in the Administration, and therefore I asked John for his resignation, which was given to me this morning. I thank John very much for his service. I will be naming a new National Security Advisor next week."

Trump's first phone call to McMaster was last fall, the report said, six months after Bolton took over as the nation's chief national security official. His most recent call to McMaster was said to be just a few months ago.

Read more: John Bolton's abrupt firing shows how chaotic Trump's White House is

McMaster's departure from the White House last year came after months of speculation about his precarious standing with Trump. There were also times when McMaster's differences with the president leaked out into public view, as when Trump took to Twitter to dispute McMaster's assessment of Russian interference in the US electoral system.

McMaster and other administration officials at the time, including Defense Secretary Jim Mattis and Secretary of State Rex Tillerson, were also frequently at odds with the nationalist wing of the White House, led at the time by the chief strategist Steve Bannon.

"There is a split in the White House between the Bannon camp of ideologues and the McMaster-Mattis-Tillerson camp of more centrist intellectuals," Pete Mansoor, a retired Army colonel who worked closely with McMaster, told Politico in 2017. "And this conflict is playing out in real time as the Trump administration tries to flesh out its foreign policy and national security policy."

All three men were later ousted as Trump sided with Bannon and others like the White House aide Stephen Miller. In fact, by the time McMaster was dismissed, his split with the president had become something of an open secret because Trump had begun complaining that he didn't like McMaster's style and also left him out of meetings and national security briefings.

For that reason, NBC News reported, it came as a surprise to people close to Trump when he reached out to McMaster, and many saw it as a sign of how far out of Trump's favor Bolton had fallen.

Read more: The US extracted a top spy from Russia after Trump revealed classified information to the Russians in an Oval Office meeting

But the president also has a habit of reaching out to an aide's predecessor whom he fired when that aide is at odds with him. For instance, he reached out to his first chief of staff, Reince Priebus, when tensions rose with his second chief of staff, John Kelly.

Trump and Bolton have a long record of clashing on matters of national security and foreign policy; those differences were a big part of why many of Trump's advisers were initially surprised when the president tapped Bolton to be his national security adviser.

Perhaps one of the biggest points of disagreement between the two was Iran. Bolton was one of the key proponents of pulling out of the Iran nuclear deal, and he was instrumental in persuading Trump to pull out of the agreement. But in recent months, Trump is said to have been increasingly frustrated because he believed Bolton was pushing for regime change and war with Iran, which went against Trump's nonintervention platform.

NBC News reported that at least one of Trump's calls to McMaster focused on Iran. Trump and Bolton also disagreed on other hot-button issues like how to deal with North Korea and Russia.

Bolton, for his part, contested Trump's claim on Tuesday that he dismissed the national security adviser the previous night.

"I offered to resign last night and President Trump said, 'Let's talk about it tomorrow,'" he tweeted.