The White House promptly accepted Mr. Shaubâs resignation and Lindsay E. Walters, a White House spokeswoman, said in a statement that it âappreciates his service.â Mr. Trump, she said, would nominate a successor âin short order.â
In departing ahead of schedule, Mr. Shaub has handed Mr. Trump an opportunity to begin putting his mark on the agency overseeing the federal governmentâs vast ethics program, including that of the White House. The officeâs director traditionally has had wide latitude to set its priorities, its tone in working with the White House and other federal agencies and, perhaps most important, how to interpret the countryâs ethics laws.
The impending vacancy is all but certain to raise fears among Democrats and those in the small world of government ethics who see the office under Mr. Shaub as an important political bulwark against conflicts of interest in the upper echelons of the government. To Mr. Trumpâs defenders, who have seen Mr. Shaub, an Obama appointee, as politically motivated, it is more welcome news.
The intensity of feeling over what is usually an obscure job speaks to the central role ethics have come to play in Mr. Trumpâs Washington, where the vast holdings of the president and his cabinet, as well as an influx of advisers from businesses and lobbying firms, have raised a rash of accusations of conflicts of interest.
It is the job of the ethics office, a creation of a post-Watergate Congress, to work with a web of ethics officials at each agency to help those entering the government sidestep potential conflicts. The office guides each administrationâs political appointees though financial disclosure requirements and creates agreements to restrict participation in deliberations over topics they handled for paying clients.
Mr. Shaub, 46, has faced an uncertain future at the agency since Mr. Trump took office in January. In the weeks between the presidentâs unexpected election victory and his inauguration, Mr. Shaub had taken an extraordinary gamble: He advocated very publicly on Twitter, and in a rare public speech, that Mr. Trump liquidate his vast business and personal holdings. The arrangement, Mr. Shaub argued, was the only truly ethical option.
Mr. Trump did not heed his advice, and by the middle of January, Mr. Shaub thought he might be fired. To minimize his attachment to the position, he packed up the personal possessions that filled his office.
But he was not fired, even as he continued to spar with Mr. Trumpâs aides over a range of ethical concerns, including the ethics officeâs authority to exercise oversight of the White House.
In February, he recommended that the White House discipline Kellyanne Conway, a top adviser to the president, after she made an on-air endorsement of the clothing line of Ivanka Trump, the presidentâs daughter. The White House Counselâs Office disagreed and took no disciplinary action.
More recently, Mr. Shaub and the administration fought over a routine request by the ethics office for copies of waivers issued to White House appointees to work in the Trump administration. The Office of Management and Budget initially balked at the request, challenging Mr. Shaubâs legal authority even to ask for the information and asking him to withdraw it. After Mr. Shaub fired back with a stern 10-page letter shooting down the argument, the White House backed down.
The White House eventually released the waivers, showing it had granted at least a dozen exemptions for aides to work on policy matters they had handled as lobbyists or to engage with former colleagues in private-sector jobs. Mr. Shaub objected to the fact that many of the waivers were undated and unsigned, and that some gave approvals for acts retroactively.
Mr. Shaub, who served for about a decade as a career civil servant at the agency before being appointed director, said his role had always been politically neutral. Rather than fighting Mr. Trump, as some critics have suggested, Mr. Shaub has said his decisions to speak out have been motivated by a desire to defend an ethics program that traditionally has counted on support from Democrats and Republicans alike. He said he spoke publicly only after other more traditional channels were exhausted.
Mr. Shaub will leave the agency this month to take up his new position as a senior director for ethics at the Campaign Legal Center in Washington, a nonpartisan group that advocates campaign finance reform and litigates voting rights cases. There, Mr. Shaub will have more freedom to comment on the governmentâs ethics program and propose a set of changes he said are needed badly.
News of Mr. Shaubâs impending departure was greeted on Thursday with more acquiescence than surprise. Those who have worked in the ethics office or in the White House said it raised pressing questions over whether Mr. Trumpâs choice of Mr. Shaubâs successor would quiet the agencyâs criticism.
âI donât think anyone who comes after Walter is going to challenge the White House publicly the way that I think he did,â said Richard W. Painter, who served as ethics counsel for the George W. Bush White House. âIt is a great loss.â
Mr. Painter said the administration would do itself a favor by naming a successor with experience in ethics law and a reputation for independence.
A permanent replacement for Mr. Shaub would require confirmation in the Senate, where Democrats would probably use confirmation hearings to raise grievances about what they see as Mr. Trumpâs own potential conflicts of interest and Republicans are unlikely to act as a rubber stamp.
The White House could also elect to simply leave the position to an acting director indefinitely. Shelley K. Finlayson, the officeâs chief of staff, is first in line for the acting director position, but the law governing such vacancies also allows the White House to choose from among the officeâs upper ranks.
That arrangement, the experts said, could help preserve the office and allow it to go about much of its work. Or, it could simply be a quieter way to effectively neutralize it, said Marilyn L. Glynn, who served as the agencyâs acting director during the George W. Bush administration.
âBased on my experience as acting director, you clearly donât have the visibility and power that a full director would have,â Ms. Glynn said. âThat is one way of keeping the office fully below the radar.â