WASHINGTON — The top federal government ethics watchdog, who has clashed with President Donald Trump over his personal business interests and the vetting of his nominees for conflicts of interest, submitted his resignation Thursday.

Walter Shaub said in a letter to Trump that he is leaving his five-year term as director of the U.S. Office of Government Ethics nearly six months early, and the Campaign Legal Center, a nonpartisan legal advocacy group, announced he would join its staff as ethics director.

Shaub posted his resignation letter, effective July 19, on Twitter. The ethics office vets presidential nominees and other top officials’ personal financial disclosure statements for potential conflicts of interests, and works out plans to mitigate those issues.

In the letter, Shaub emphasized in italics that the principle of the office is that “public service is a public trust,” which requires federal employees “to place loyalty to the Constitution, the laws and ethical principles above private gain.”

Shaub did not expect Trump to appoint him to another term. President Barack Obama named him to the post, which requires Senate confirmation, in January 2013 after Shaub had worked in the office for nearly a decade.

“It’s clear that there isn’t more I could accomplish,” Shaub told The Washington Post. “O.G.E.’s recent experiences have made it clear that the ethics program needs to be strengthened.”

Trump, the target of Shaub’s often public and outspoken ethical advice, will now be able to appoint Shaub’s replacement.

advertisement | advertise on newsday

Senate Minority Leader Chuck Schumer (D-N.Y.) promised a thorough examination of Trump’s nominee, who must demonstrate commitment to “actually draining the swamp and ensuring administration officials are not using their positions for personal gain.”

Schumer added, “The next director should also be steadfast in preventing lobbyists and other representatives of special interests from further rigging the system against working families under the cover of darkness, as this administration attempted to do in recent months.”

Schumer was referring to the most recent clash between Shaub and the Trump administration over his efforts to gather information about lobbyists and other appointees granted waivers to ethics rules so they could interact with their former employers.

The Office of Management and Budget initially blocked the request, but backed down after Shaub wrote a 10-page letter that said federal agencies must comply for the sake of “public confidence in the integrity of government decision making.”

Shaub began a rare public campaign in a string of tweets to urge Trump to divest himself of his extensive and far-flung business interests three weeks after Trump won the election.

When Trump announced he would retain ownership of his business but would transfer management to his sons, Shaub in a speech called Trump’s plan inadequate and urged him to put his assets in a blind trust. Trump did not follow his advice.

In February, Shaub called for the White House to discipline adviser Kellyanne Conway for promoting Ivanka Trump’s clothing line while appearing on cable TV news, but the White House counsel disagreed and took no action.

Trevor Potter, president of the Campaign Legal Center, said, “Walter will continue in his mission to improve the federal ethics program from the outside, and he will have the opportunity to address ethics issues in Congress, as well as at the state and local level.”