Keith Wellner, a hedge fund adviser, has agreed to plead guilty and to cooperate with prosecutors who are preparing to try film producer David Bergstein for an alleged $26 million fraud scheme.

Wellner pleaded guilty in federal court in Manhattan to six counts of securities fraud, investment adviser fraud, and wire fraud. Under terms of the plea agreement, signed on Dec. 18, Wellner agreed to cooperate with the FBI and to testify in court.

Prosecutors alleged that Bergstein and Wellner worked together to defraud investors out of at least $26 million in 2010 and 2011. At the time, Wellner was general counsel and chief operating officer of Weston Capital Asset Management. According to the indictment, Wellner agreed to loan $9 million of Weston investor funds to Arius Libra, a fund managed by Bergstein. In a separate instance, Wellner secretly invested $17.7 million in Schwartz IP Services, another Bergstein entity. In both cases, prosecutors allege that investors were misled about the source of the funds.

Prosecutors also claim that Bergstein used much of the proceeds to pay his personal expenses, including legal fees and credit card bills. In one transaction referenced in a Securities and Exchange Commission complaint, Bergstein allegedly used investor funds to pay a home entertainment contractor, to shop at an antiques store, and to visit a Las Vegas nightclub.

Bergstein and Wellner were arrested and charged with securities fraud in November of 2016. Bergstein is scheduled to go on trial on Feb. 5, and remains free on a $2 million bond.

Bergstein formerly ran ThinkFilm and Capitol Films Development, which were forced into bankruptcy in 2010. He also produced such movies as “Before the Devil Knows You’re Dead,” “Laws of Attraction,” and most recently, “In the Heart of the Sea,” which was released in 2015.

Wellner is set to be sentenced on May 30.