Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — Hours after the head of the Consumer Financial Protection Bureau tried to name his own successor Friday, President Donald Trump intervened by appointing his budget director, Mick Mulvaney, to run the agency on an interim basis.

Mulvaney said in a statement that he would stay on as head of the Office of Management and Budget, running both agencies simultaneously.

The resignation of Richard Cordray as the board's director wasn't a surprise, but the timing was: Cordray, the agency's first-ever head, had announced earlier this month that he would be stepping down by the end of November.

Consumer Financial Protection Bureau Director Richard Cordray during a Senate hearing in Washington in on September 2016. Saul Loeb / AFP - Getty Images file

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But in his resignation letter, Cordray told Trump that he is leaving his post effective at midnight. And he named the agency's chief of staff, Leandra English, to the post of deputy director — setting up a clash with the White House over who controls an Obama-era agency that conservatives have heavily criticized.

"In considering how to ensure an orderly succession for this independent agency, I determined that it would be best to avoid leaving this key position filled only in an acting capacity," Cordray told his staff in an email obtained by American Banker.

Under the law that created the CFPB, the 2010 Dodd-Frank rewrite of the nation's financial industry regulatory regime, the deputy director serves "as acting director in the absence or unavailability of the director."

The Dodd-Frank Act is clear: if there is a @CFPB Director vacancy, the Deputy Director becomes Acting Director. @realDonaldTrump can’t override that. pic.twitter.com/r949ccaJAb — Elizabeth Warren (@SenWarren) November 25, 2017

Trump is known to have been considering appointing Mulvaney to run the agency, whose independent status he has long criticized.

"The place is just a wonderful example of how a bureaucracy will function if it has no accountability to anybody," Mulvaney said in an interview with the Credit Union Times three years ago. "It turns up being a joke and that's what the CFPB really has been in a sick, sad kind of way."

Cordray is widely expected to run as a Democrat for governor of Ohio in 2018. Gov. John Kasich, a Republican, is term-limited and cannot run for re-election.

Jonathan Allen reported from Washington. Alex Johnson reported from Los Angeles.