Senior executives at JPMorgan Chase expressed serious doubts about the legitimacy of Bernard L. Madoff’s investment business more than 18 months before his Ponzi scheme collapsed but continued to do business with him, according to internal bank documents made public in a lawsuit on Thursday.

On June 15, 2007, an evidently high-level risk management officer for Chase’s investment bank sent a lunchtime e-mail to colleagues to report that another bank executive “just told me that there is a well-known cloud over the head of Madoff and that his returns are speculated to be part of a Ponzi scheme.”

Even before that, a top private banking executive had been consistently steering clients away from investments linked to Mr. Madoff because his “Oz-like signals” were “too difficult to ignore.” And the first Chase risk analyst to look at a Madoff feeder fund, in February 2006, reported to his superiors that its returns did not make sense because it did far better than the securities that were supposedly in its portfolio.

Despite those suspicions and many more, the bank allowed Mr. Madoff to move billions of dollars of investors’ cash in and out of his Chase bank accounts right until the day of his arrest in December 2008  although by then, the bank had withdrawn all but $35 million of the $276 million it had invested in Madoff-linked hedge funds, according to the litigation.