People walk past by a branch of Halkbank in central Istanbul, Turkey, January 22, 2020. [Murad Sezer/Reuters]

A federal judge dismissed on Wednesday the US Justice Department’s criminal indictment of Halkbank after President Donald Trump’s administration reached a deal with the ‌Turkish state-run lender, ending a prosecution brought in 2019.

The bank’s shares on the Istanbul stock exchange rose as much as 8.4% after US District Judge Richard Berman said he had signed off on federal prosecutors’ request to end the case. The deal was announced in March but required the judge’s approval.

The dismissal promised to relieve a lingering irritant between NATO allies Turkey and the United States.

Halkbank was charged during Trump’s first term with helping Iran evade American economic sanctions. Turkish President Tayyip Erdogan once called the case unlawful and “ugly.” But the countries are experiencing their best ties in decades since Trump’s return to the presidency last year.