After repeated appeals to President Trump by Turkey’s president to avoid charges against a state-owned Turkish bank, Attorney General William P. Barr oversaw an effort earlier this year to negotiate a settlement with the bank, two people with knowledge of the matter said.

The settlement push abruptly ended on Tuesday when prosecutors in New York filed bank fraud and money laundering charges against the institution, Halkbank, a move that came as Mr. Trump sought to escalate pressure on Turkey to stop its military operations in northern Syria.

But the criminal charges were filed only after more than a year of interventions by President Recep Tayyip Erdogan of Turkey and other senior officials of his government, as well as lawyers and lobbyists working in New York and Washington on Turkey’s behalf, to try to avoid a criminal prosecution of the bank.

Mr. Erdogan had repeatedly raised the topic of Halkbank with Mr. Trump, including in a November 2018 phone conversation, which was followed up by an appeal by Mr. Erdogan’s son-in-law, who serves as Turkey’s finance minister, with Treasury Secretary Steven Mnuchin. Bloomberg News reported on Wednesday that Mr. Trump told Mr. Erdogan in April that Mr. Barr and Mr. Mnuchin would handle the matter.