President Trump on Friday named his budget director as the acting director of the Consumer Financial Protection Bureau, moving to take control of the agency hours after its departing leader had taken steps to install his own choice for acting chief.

By the end of the night, an agency born of the financial meltdown — and one Republicans have tried to kill from the start — had dueling directors, and there was little sense of who actually would be in charge Monday morning.

The bureaucratic standoff began Friday afternoon when Richard Cordray, the Obama-appointed leader of the bureau, abruptly announced he would leave the job at the close of business, a week earlier than anticipated. He followed up with a letter naming his chief of staff, Leandra English, as the agency’s deputy director.

The announcement came with a twist. Under the law, he said, that appointment would make the new deputy director the agency’s acting director. The move was seen as an effort to delay Mr. Trump from appointing his own director, whose confirmation could take months.