Office of Government Ethics Director Walter Shaub Jr. announced Thursday he is resigning before the end of his term, leaving after a series of clashes with President Trump.

Shaub’s resignation is effective July 19, he said in a short resignation letter to Trump.

“The great privilege and honor of my career has been to lead OGE’s staff and the community of ethics officials in the federal executive branch,” Shaub said.

“I am grateful for the efforts of this dedicated and patriotic assembly of public servants, and I am proud to have served with them,” he added.

In his position leading the nation’s top government watchdog agency, Shaub had tensions with the Trump administration.

After Trump made it clear in January he would not sell off his global business empire to avoid the appearance of conflicts of interest, Shaub spoke out. He said Trump's plan to retain financial interests in the Trump Organization while handing over leadership to his adult sons and a senior executive "doesn't meet the standards" of Trump's own Cabinet nominees and four decades of previous presidents.

Since then, the OGE has unsuccessfully asked the White House to punish a senior adviser to the president over inappropriately promoting Ivanka Trump's fashion line.

Shaub will join the Campaign Legal Center, an organization in Washington that mostly focuses on violations of campaign finance law, according to the nonprofit’s Twitter.

He says he will continue working on government ethics issues and will push for ways to strengthen a program that is designed to help thousands of executive branch employees avoid conflicts of interest.

Shaub is a career OGE employee who was appointed director by former President Barack Obama. His term was set to expire next year.

The Associated Press contributed to this report.