A Manhattan federal judge ruled Tuesday that 10 investment firms could keep more than $500 million that Citibank had mistakenly transferred to them last year, in what he called a “banking error of perhaps unprecedented nature and magnitude.”

U.S. District Judge Jesse M. Furman of the Southern District of New York said in a 105-page opinion that the asset managers believed in “good faith and with ample justification” that the transfers were actually repayments on a loan to cosmetic company Revlon Inc.