New York state and New York City on Tuesday sued Bank of New York Mellon, claiming the financial institution defrauded New York City pension funds and other city retirement plans in foreign-exchange transactions, according to a news release from New York Attorney General Eric Schneiderman.

In a separate suit, the U.S. attorney's office in New York filed its own lawsuit in U.S. District Court in New York against BNY Mellon.

“Over a 10-year period, BNY Mellon consistently misrepresented to customers the rates it would give foreign currency transactions,” the news release from Mr. Schneiderman said. “Instead of providing the best interbank rates — as it promised — BNY Mellon gave the worst or nearly the worst rates of the trading day.

“The bank made nearly $2 billion from these trades, accounting for over 65% of its foreign-exchange revenues,” the release said.

New York City pension funds “were among the most impacted of BNY Mellon's clients and lost tens of millions of dollars as a result of its fraudulent rates,” according to the release, which did not provide specific figures.

The suit was filed in the State Supreme Court in Manhattan.

BNY Mellon will fight the lawsuits, said Kevin Heine, a spokesman for the bank. The complaints are based on the same “flawed analysis” and a misunderstanding of the global foreign-exchange market, he said.

In the federal complaint, the U.S. attorney claimed BNY Mellon defrauded clients that used its “standing instruction” foreign-exchange service under which the bank automatically provides currency exchange when the client buys or sells foreign securities.

BNY Mellon determines the price clients receive on the currency trades and consistently gives them “virtually the worst rates of the day,” federal prosecutors said. The bank obtains more favorable prices for itself on the spot market and pockets the difference. BNY Mellon's conduct was most egregious during the 2008 financial crisis when currency prices were volatile.

“This unprecedented volatility allowed BNYM to pass on extremely poor pricing to its clients while earning massive gains on the much better pricing BNYM was able to obtain on the spot market,” the government said in its complaint.

“Unfortunately, the U.S. attorney does not appear to have made any serious independent effort to assess the validity of the claims in this lawsuit,” Mr. Heine said. “We will fight these claims vigorously and are confident we will prevail.”

Bloomberg contributed to this story.