Russia has dropped its $22.5 billion lawsuit against Bank of New York Mellon , in line with an earlier request by the country's Customs Service, a judge said on Thursday.

The court has examined the Customs Service's request to withdraw the case against the Bank of New York Mellon and the case is closed, judge Lyudmila Pulova said.

Russia had been seeking compensation from the bank after its former vice president, Lucy Edwards, helped illegally transfer $7 billion out of Russia in the late 1990s through Bank of New York accounts.

The lawsuit, brought by the Federal Customs Service, has been closely watched by investors and clients of Bank of New York Mellon, which is the world's largest custodian of financial assets.

We are very pleased to have this behind us, Bank of New York Mellon's Executive Vice President Matthew Biben told reporters.

Bank of New York Mellon has agreed to pay the Customs Service $14 million in legal fees and open a trade finance credit facility for Russian banks renewable every 180 days for an amount totaling $4 billion over five years.

Terms and conditions are to be discussed in bilateral discussions. The rates will be commercial, reasonable rates, Biben said in a statement.

(Reporting by Dmitry Sergeyev; Writing by Gleb Bryanski; Editing by David Holmes)