Washington (CNN) Dan Coats will step down as the director of national intelligence on August 15 , President Donald Trump announced Sunday in a tweet, a departure that marks the most recent chapter in Trump's tense and puzzling relationship with the US intelligence community.

Texas Republican Rep. John Ratcliffe, who aggressively questioned former special counsel Robert Mueller last week during Congressional hearings involving his report on Russian interference in the 2016 presidential election, will be nominated by the President to replace Coats.

"I would like to thank Dan for his great service to our Country," Trump tweeted. "The Acting Director will be named shortly."

The former senator became director of national intelligence at a difficult time -- for a President who repeatedly made clear his dislike and distrust of intelligence services -- and spent his tenure in the administration at odds with Trump, helming a constellation of over a dozen agencies that the President has publicly mocked, ignored and dismissed. The unsettling dynamic has created one of the more unusual spectacles of Trump's presidency and raised questions about his motivations, particularly as they relate to investigations into possible collusion between Moscow and members of his 2016 presidential campaign.

"I have ensured that we have the capabilities necessary to protect against those who would do us harm," Coats wrote in his resignation letter to the President.

He added, "I believe it is time for me to move on to the next chapter of my life."

A former senior intelligence official who worked with Coats said he did not believe there was any single national security issue that he was regularly dealing with that brought him to a point where he was ready to step down, but instead likely just felt it was time to move on. "This isn't a lifetime appointment," the former official said.

"Dan Coats has repeatedly demonstrated an ability to stay above the issues which dominate Washington politics. Within the (intelligence community), he is considered to be a capable, candid, and non-partisan leader who takes his work coordinating IC resources seriously as well as someone who has brought stability to the IC," the former official told CNN.

The President, though, regularly fumed about Coats, and the two never clicked on a personal level. Trump has been on the brink of firing him in the past, though aides were able to convince the President not to do so.

In May, Attorney General William Barr was ordered to conduct a politically-charged Justice Department review of how the Russia investigation began and the intelligence community's role in that process.

At the time, Coats said that Barr would get "all the appropriate information" for the review of intelligence into Russia's election attacks but he also warned the attorney general against being too public with what he declassifies.

"I am confident that the Attorney General will work with the IC in accordance with the long-established standards to protect highly-sensitive classified information that, if publicly released, would put our national security at risk," Coats said in a statement.

Trump's evident hostility and distrust of his own intelligence agencies made Coats' job as director arguably one of the most politically fraught in Washington. His departure is just the latest in the churn among the President's most senior officials.

Coats, a former ambassador and Republican senator from Indiana praised for his bipartisan professionalism, stepped into the job leading US spy agencies and serving as the President's principal adviser on intelligence in March 2017.

Vice President Mike Pence was one of Coats' closest allies as the two men shared a long history dating back to their time in Congress.

But Trump and Coats never forged a particularly close relationship and the President has time and again voiced frustrations about Coats, telling advisers that he considered Coats in line with other top officials who have sought to restrain him like former Defense Secretary Jim Mattis and former White House chief of staff John Kelly.

And in under a year, Trump confidants were suggesting Coats could be fired.

Coats vs. Trump on North Korea

While Trump had complained about Coats in the past, White House officials began preparing in earnest for his ejection after the Presidents Day holiday weekend, which Trump had spent venting to friends and advisers about Coats, two senior administration officials told CNN.

Trump was still steaming about statements Coats and other officials had made three weeks earlier when they delivered an annual report to Congress on worldwide threats. Coats laid out the intelligence community's assessments, undercutting the President's claims on issues ranging from Iran to Russia, climate change and the status of ISIS.

Trump appeared most irritated by Coats' assessment on North Korea. Despite the President's assertion that North Korean leader Kim Jong Un will move toward giving up his nuclear weapons, Coats and the other officials said it was their assessment that Kim would likely never do so.

In the days leading up to Coats' dismissal, his backers and the President's surrogates were reaching out to the media in an attempt to frame the issue. Coats' allies worked to defend the former senator, while the President's friends tried to raise doubts about Coats and set the stage for Trump's move.

Chris Ruddy, a longtime Trump confidant, told CNN's Christiane Amanpour on February 18 that he was "hearing from sources around the White House there's just general disappointment of the President with Director Coats. There's a feeling that maybe there needs to be a change of leadership in that position."

Speaking in the run-up to a second meeting between Trump and Kim set for the end of February, Ruddy said, "I think generally there's a deep concern that on the eve of the North Korea (summit) to have your director of national intelligence in open hearings undercutting your position was very bad form."

Coats' former colleagues came to his defense and questioned Trump's ability to deal with information that doesn't confirm his worldview.

As rumors swirled that Coats could be jettisoned, Sen. Angus King, an independent from Maine, told CNN's John Berman on February 19 that "if in fact Dan Coats is pushed out -- which I deeply hope isn't the case, because he's a great public servant, but if he is -- the message is don't give me the facts."

Republican Sen. Susan Collins of Maine tweeted the next day: "DNI Coats is a good friend, former Senate colleague, and leader of integrity who has always served our country well. We are fortunate to have a person of his ability and candor to lead our intelligence community."

Ultimately, Trump quickly papered over the discord and moved on with Coats remaining in his role.

But the President appeared to revive conversations about possibly removing Coats in July, raising the idea with confidants and rehashing old frustrations about the intelligence chief.

A senior White House official confirmed at the time that there was some discussion about Coats leaving his position, as he has been on the job for more than two years and is eyeing retirement again.

Life in politics

The 76-year-old Coats served in the military before going to law school. He joined the House of Representatives in 1981 and then moved on to the Senate before being appointed US ambassador to Germany in 2001, during President George W. Bush's first term. In 2011, Coats returned to the Senate, where he served on the Intelligence and Armed Services committees, retiring in 2017.

Before he was elected, Trump was asked in an August 2016 interview with Fox News whether he trusted intelligence. "Not so much from the people that have been doing it for our country," Trump said. "Look what's happened over the last 10 years. Look what's happened over the years. It's been catastrophic."

He went on, saying, "In fact, I won't use some of the people that are sort of your standards, you know. ... I won't use them because they've made such bad decisions."

Trump's answer displayed a misunderstanding of how intelligence agencies work. They do not make decisions or craft policies, but simply offer their assessments of situations so political leaders can make the best-informed decisions. That disconnect would continue to play out publicly in the months to come.

In December 2016, after the CIA announced it believed Russia had interfered directly in the election, hoping to put Trump in the White House, the President didn't dismiss the reporting but instead attacked the CIA, saying that "these are the same people that said Saddam Hussein had weapons of mass destruction."

In January 2017, Trump compared the intelligence agencies to Nazis after news leaked that they had briefed him about potential Russian attempts to blackmail him.

In March of that year, Trump asked Coats and Michael Rogers, director of the National Security Agency, to publicly push back against then-FBI Director James Comey's investigation into possible coordination between Moscow and his presidential campaign. Coats and Rogers were uncomfortable with the nature of the President's request and refused to comply, sources with knowledge of the situation told CNN.

Coats vs. Trump on Moscow

In July 2018, in perhaps his most public rift with Coats and the intelligence community, Trump stood beside Russian President Vladimir Putin and publicly said he doubted US spies' assessment that Russia had tried to interfere in the election, declaring that Putin had vigorously denied it.

Coats afterward issued a statement reiterating the conclusion that Moscow had indeed worked to sway the election results. Shortly afterward, while onstage at a conference, the intelligence director was visibly surprised by an announcement that Trump was planning on inviting Putin to Washington.

"That's going to be special," Coats quipped, later apologizing and saying he had not meant to be disrespectful.

The January worldwide threats hearing, mandated annually by Congress, seemed to mark a turning point. The officials, under oath, must answer truthfully on matters that aren't classified and can be discussed in an open setting. Their answers made clear the vast gulf between intelligence community assessments and the President's assertions on any number of national security issues.

Trump ripped Coats and other leaders the next day in a series of tweets, while his allies said intelligence officials should not publicly air assessments that differ from the President's.

"The Intelligence Committee should give Trump officials their reservations about policy on ISIS, North Korea, Iran, etc., but when Intelligence agencies do so publicly, they are undermining the administration," Fred Fleitz, a former chief of staff for the National Security Council, told Fox News.

Coats and CIA Director Gina Haspel had testified that Iran is continuing to comply with the international nuclear treaty that Trump decided to abandon in May 2018, prompting the President's tweet that they are "extremely passive and naive when it comes to the dangers of Iran."

While Trump had insisted that the US has won against ISIS in Syria and would therefore be withdrawing troops from the country, Coats told Congress that "ISIS is intent on resurging and still commands thousands of fighters in Iraq and Syria."

Coats and his colleagues also flagged the impacts of climate change, which the President rejects, and stressed the threat posed by Russian attempts to undermine US elections and democracy, a stance the President has undercut or opposed.