CFPB director Richard Cordray. Photo: Diego M. Radzinschi/ALM

Richard Cordray is stepping down as the director of the Consumer Financial Protection Bureau after spending more than five years building up the Obama-era agency from scratch and fostering it into a powerful regulator.

Cordray, announcing his plans to CFPB staff Wednesday, said he expects to leave before the end of the month. His five-year term was set to expire in July 2018.

“As I have said many times, but feel just as much today as I ever have, it has been a joy of my life to have the opportunity to serve our country as the first director of the Consumer Bureau by working alongside all of you here,” Cordray, who’s led the agency since 2012, said.

“Together we have made a real and lasting difference that has improved people’s lives, notably: $12 billion in relief recovered for nearly 30 million consumers; stronger safeguards against irresponsible mortgage practices that caused the financial crisis and hurt millions of Americans; giving people a voice by handling over 1.3 million complaints that led to problems getting fixed for vast numbers of individuals, and creating new ways to bring financial education to the public so that people can take more control over their economic lives,” Cordray said.

Cordray continued: “None of this could have happened without all of us being dedicated to pull together in supporting and protecting people and making every consumer count. I will always be immensely proud of you and what you have done.”

Cordray made no mention of his long-rumored interest in the Ohio governor’s race, but his departure is sure to fuel further speculation of a campaign. Last month, a federal agency cleared Cordray of allegations that he improperly positioned himself for a gubernatorial run while serving as the CFPB director.

A champion to consumer advocates, Cordray has been scorned by Republicans and many in the financial industry as an overzealous regulator who’s used his tenure atop the CFPB to aggressively test the limits of the agency’s — and, by extension, his own — authority. Cordray’s exit opens the door for President Donald Trump to install a more industry-friendly leader who could downshift the agency’s enforcement engine and revisit controversial regulations.

Since Trump took office in January, the CFPB showed no indication it was backing down in the face of an unfriendly Trump administration. In addition to finalizing restrictions on arbitration agreements and the first comprehensive regulations on the prepaid card market, the agency has pursued enforcement actions against the likes of Navient and Ocwen Corp., leading servicers of student loans and mortgages, respectively. The push to restrict arbitration failed in October when Congress overturned the rule.

It has done so while the Justice Department, under the leadership of U.S. Attorney General Jeff Sessions, switched sides in a case contesting the agency’s constitutionality and argued — against the CFPB — that the president should be empowered to readily fire Cordray and future directors. Meanwhile, the U.S. Treasury Department under Secretary Steve Mnuchin proposed reforms to financial regulation that included stripping the CFPB of its independence or, in the alternative, transforming the bureau into a five-member commission akin to the Securities and Exchange Commission and Federal Trade Commission.