Merrill Lynch & Co. on Thursday agreed to pay Enron Corp. $29.5 million to settle its portion of a lawsuit filed against 10 banks accused of failing to prevent the energy company’s collapse.

The New York-based securities firm — which did not admit or deny wrongdoing — said it settled the so-called MegaClaims lawsuit to avoid the costs and uncertainties of more litigation.