A Mexican cocaine-trafficking cartel used accounts at Bank of America Corp. to hide money and invest illegal drug-trade proceeds in U.S. racehorses, the Federal Bureau of Investigation said.

The alleged ties between the violent drug gang known as Los Zetas and the second-largest U.S. bank by assets were described in a 35-page affidavit filed in federal court in Texas last month. According to an FBI agent, a horse-buying and training business created to launder drug money had accounts at the Charlotte, N.C., bank.

A...