Signage inside the Consumer Financial Protection Bureau (CFPB) headquarters in Washington in March. (Andrew Harrer/Bloomberg News)

A senior Trump appointee forced to apologize for posts he wrote years ago questioning whether the n-word was racist and expressing skepticism about hate crimes announced Wednesday that he is stepping down.

Eric Blankenstein, a policy director at the Consumer Financial Protection Bureau responsible for enforcing the country’s fair lending laws, said in an email to co-workers obtained by The Washington Post that his last day would be May 31.

“It has been my privilege to serve the American people here to further the Bureau’s mission of protecting consumers and ensuring safe, fair and competitive markets for consumer financial products and services,” he said in the email. “I wish you all health and happiness in the years to come.”

In the email, Blankenstein said that he had secured another job but did not say what it was. He did not respond to an email from The Post seeking comment.

Blankenstein has been operating under a cloud since September, when The Post reported on blog posts he had written more than a decade ago. In one post, Blankenstein described abortion as the “state sponsored destruction of life.”

In another, he repeatedly questioned the need for special enforcement of hate crimes. “Shouldn’t we be more concerned that the crime happened period?” he wrote. “Does it matter that someone got beat up because they were black, or does it matter that someone got beat up?”

He faced an open rebellion from subordinates who sent mass emails harshly criticizing his writings. Several Democratic senators also called for Blankenstein to be fired.

Blankenstein later said he regretted “some” of the things he wrote. “The tone and framing of my statements reflected poor judgment,” he said in a note to colleagues last October.

The CFPB’s then-acting director, Mick Mulvaney, referred the matter to the bureau’s inspector general. The inspector general’s office declined to comment.

“Eric Blankenstein should have been fired for his hateful, reprehensible and disgusting blog posts,” Sen. Sherrod Brown of Ohio, the ranking Democrat on the Senate Banking Committee, said in a statement. “Allowing him to resign is a serious moral and managerial failure that sends a signal to consumers that the CFPB will look the other way when it comes to discrimination.”

Blankenstein previously worked as a private-sector lawyer and represented banks involved in regulatory investigations launched by the agency he now helps lead. He is responsible for supervising lenders and enforcing an array of consumer protection laws, including the 40-year-old Equal Credit Opportunity Act, landmark civil rights legislation aimed at protecting minorities from discriminatory practices and promoting “fair lending.”

His elevation at the CFPB was part of a Trump-era overhaul of the agency. The bureau’s director, Kathy Kraninger, has laid out a business-friendly vision for the CFPB, which had been lambasted by Republicans for years as too aggressive.