President Donald Trump announced in a tweet Sunday that Director of National Intelligence Dan Coats would soon leave the administration and, in his place, the president will nominate Rep. John Ratcliffe, R-Texas, to replace Coats.

"I am pleased to announce that highly respected Congressman John Ratcliffe of Texas will be nominated by me to be the Director of National Intelligence," Trump tweeted. "A former U.S. Attorney, John will lead and inspire greatness for the Country he loves. Dan Coats, the current Director, will be leaving office on August 15th. I would like to thank Dan for his great service to our Country. The Acting Director will be named shortly."

In a resignation letter submitted Sunday, Coats said that he had overseen the reauthorization of surveillance rules allowing the United States to collect the online communications of foreigners outside the United States, addressed threats to U.S. elections and streamlined the intelligence community's budget processes.

"The Intelligence Community is stronger than ever, and increasingly well prepared to meet new challenges and opportunities," he wrote.

Coats, a former senator from Indiana, had not seen eye to eye with Trump on issues like Russian electoral interference and the president's past blasting of the intelligence community. Administration officials told NBC News in March that Coats considered resigning last year over the rift but that Vice President Mike Pence persuaded him to stay on.

Late on Sunday, Ratcliffe tweeted that he was "deeply grateful" to Trump for "the opportunity to lead our Nation’s intelligence community and work on behalf of all the public servants who are tirelessly devoted to defending the security and safety of the United States."

"President Trump’s call to serve in this role was not one I could ignore, and I am incredibly thankful to him for this great honor," he wrote. "I look forward to my new role with energy and focus."

Ratcliffe's nomination follows his sharp questioning of former special counsel Robert Mueller during his congressional testimony last week.

A staunch ally of the president from a deep-red district, Ratcliffe won accolades among the president's allies for his questioning of Mueller, which included the lawmaker's saying "nowhere does it say that [the special counsel was] to conclusively determine Donald Trump's innocence or that the special counsel report should determine whether or not to exonerate him."

"I agree with the chairman this morning when he said Donald Trump is not above the law. He's not," Ratcliffe said. "But he damn sure shouldn't be below the law, which is where Volume II of this report puts him."

Critics of Ratcliffe's answer noted that Justice Department guidelines state that a special counsel should, upon conclusion of an investigation, provide a report "explaining the prosecution or declination decisions."

Coats was famously caught off guard last year when he appeared to have first learned about a potential visit from Russian President Vladimir Putin during an interview with NBC News' Andrea Mitchell.

"Say that again?" Coats asked Mitchell at the Aspen Security Forum event, adding, "That is going to be special."

In January, Trump criticized his top intelligence officials after they presented their assessments of global threats — which were at odds with his own views.

Trump tweeted: "Perhaps Intelligence should go back to school!"