WASHINGTON — Director of National Intelligence Dan Coats is leaving his job next month, ending a two-year tenure marked by President Donald Trump’s clashes with intelligence officials.

Trump tweeted Sunday that the nation’s top intelligence official would step aside on Aug. 15, and that he would nominate a Texas congressman, Republican John Ratcliffe, to the post.

Coats frequently appeared out of step with Trump and disclosed to prosecutors how he was urged by the president to publicly deny any link between Russia and the Trump campaign. The frayed relationship reflected broader divisions between the president and the government’s intelligence agencies.

Ratcliffe is a frequent Trump defender who questioned special counsel Robert Mueller last week during a House Judiciary Committee hearing.