The famously neurotic New York filmmaker settled his suit against Dov Charney, the American Apparel founder notorious for strutting in front of employees in his briefs.

Allen sued the clothing company for $10 million last year after American Apparel ran ads of him in black Hasidic garb in a scene from his film "Annie Hall" without permission.

The deal was reached moments before jury selection was set to start in Manhattan Federal Court, and before Charney's lawyers could follow through on plans to air Allen's dirty laundry.

"Threats and press leaks by American Apparel designed to smear me did not work, and a scheme to call a long list of witnesses who had absolutely nothing to do with the case was also disallowed by the court," Allen said outside court.

"I suspect this dose of legal reality led to their 11th-hour settlement."