At the White House, Mr. Trump’s handling of the matter became troubling even to some senior officials at the time.

The president was discussing an active criminal case with the authoritarian leader of a nation in which Mr. Trump does business; he reported receiving at least $2.6 million in net income from operations in Turkey from 2015 through 2018, according to tax records obtained by The New York Times.

And Mr. Trump’s sympathetic response to Mr. Erdogan was especially jarring because it involved accusations that the bank had undercut Mr. Trump’s policy of economically isolating Iran, a centerpiece of his Middle East plan.

Former White House officials said they came to fear that the president was open to swaying the criminal justice system to advance a transactional and ill-defined agenda of his own.