The consumer protection official charged with safeguarding student borrowers is resigning in protest of the Trump administration, claiming it is siding with predatory lenders over consumers and enacting policies that will lead to “far-reaching harm.”

Seth Frotman wrote in a scathing letter that he would leave his position as student loan ombudsman at the Consumer Financial Protection Bureau at the end of the week. Frotman has held the position since 2015 and has been at the bureau since 2011.

“Unfortunately, under your leadership, the Bureau has abandoned the very consumers it is tasked by Congress with protecting,” Frotman wrote to Mick Mulvaney, the bureau’s acting director. “Instead, you have used the Bureau to serve the wishes of the most powerful financial companies in America.”

Among his charges is that the bureau squashed publication of data showing banks are ripping off college students with “legally dubious” debit card fees. People familiar with the situation said that staff had discovered abuses with debit cards, which they said became vehicles for abuse after crackdowns on credit card rules. But the law only mandates that information on credit cards be published, and Mulvaney would not let the report go beyond that.

In 2016, the bureau’s 40-page report covered both credit and debit cards; the 2017 version was half as long and limited to credit cards.

In a letter sent to Sen. Jack Reed (D-R.I.) in February defending the move, Mulvaney said he was not legally required to share information on debit cards or bank account agreements.

The Washington Post obtained a copy of the resignation letter, dated Monday, which was first reported by NPR.

Frotman’s deputy, Michael Pierce, also resigned, according to an official with direct knowledge but who was not authorized to speak about the matter.

The bureau said it does not comment on personnel matters.

The consumer protection bureau, created as part of Congress’s response to the 2008 financial crisis and Great Recession, has long been a target of Republicans. Mulvaney, who is also President Trump’s budget director, has proposed killing or revising Obama administration regulations and has scaled back enforcement. He has called the CFPB a “sick, sad” joke, but cannot abolish it under federal law. Staffing has steadily declined.

The student loan ombudsman office was created to oversee the $1.5 trillion student loan market. The office was responsible for processing complaints from borrowers against loan servicers and also central to lawsuits against for-profit colleges accused of bilking students.

Frotman’s criticism of the agency’s work was sweeping. He wrote that the bureau has “abandoned its duty to fairly and robustly enforce the law,” undermining career staff as they try to investigate the student loan market.

One of the people familiar with his thinking said this is a reference to a pending lawsuit against Navient, one of the nation’s largest student loan servicing companies. Navient has been accused of widespread abuses in the collection of education debt payments, and some fear the bureau will drop its lawsuit. The company denies the charges.

Frotman also said that senior leaders at his agency had blocked efforts to speak up against the Education Department’s rollback of Obama-era rules cracking down on fraudulent for-profit colleges.

Under Secretary Betsy DeVos, the Education Department is moving to rescind or replace a number of Obama-era regulations, including making it harder for students who are defrauded to get out of paying back student loans.

Some consumer advocates were alarmed by Frotman’s departure.

Karl Frisch, executive director of Allied Progress, an advocacy group, called Frotman “a champion for students.” He added that it must have been hard for Frotman to battle both financial institutions and Mulvaney, who he said “has been stacking the deck against students since the day he arrived at the Bureau.”

Others were less disturbed by the departure. Jenny Lee, a former enforcement attorney at CFPB who now represents private financial firms in government investigations, noted that Fortman’s letter did not provide evidence to corroborate that new leadership at the agency “was taking a different approach given the limits of that office’s power under the law.”

EDITOR’S NOTE: This article has been updated to clarify the remarks made by Jenny Lee, a former enforcement attorney at CFPB.