In a surprising reversal, the struggling film studio co-founded by Harvey Weinstein has reached a deal to sell its assets to an investor group led by a former Obama administration official, the company said Thursday night.

The deal to sell the Weinstein Co. to the investor group, led by former Small Business Administration head Maria Contreras-Sweet and billionaire Ron Burkle “provides a clear path for compensation for victims and protects the jobs of our employees,” the film studio said in a statement.

The Weinstein Co. has been struggling to stay afloat since reports emerged in October in the New York Times and the New Yorker detailing allegations of sexual abuse by co-founder Harvey Weinstein spanning decades. More than 70 women have since accused him of sexual misconduct, including rape.

The announcement came just days after the New York studio declared it would file for bankruptcy, as talks to sell the company to the investor group collapsed. In a critical letter to the investor group Sunday, the Weinstein Co. said the proposed deal failed to provide necessary interim funding and lacked a provision for “‘gold standard’ human resources policies.”

“We consider this to be a positive outcome under what have been incredibly difficult circumstances,” the Weinstein Co. said Thursday.

Contreras-Sweet plans to “launch a new company, with a new board and a new vision,” she said in a statement to news outlets. She plans to create a majority-female board of directors, salvage about 150 jobs and protect the small businesses owed money by the Weinstein Co. A compensation fund would supplement existing insurance coverage for victims.

The investors did not disclose the bid’s worth, but previous news reports said the group offered $500 million, including an assumption of $225 million in debt.

“The cornerstone of our plan has been to launch a new company that represents the best practices in corporate governance and transparency,” Contreras-Sweet said. “I have had a long-standing commitment to fostering women ownership in business. This potential deal is an important step to that end.”

In the days since the bankruptcy story broke, it appears the parties returned to the negotiating table. Both groups met to reach a deal in New York Attorney General Eric T. Schneiderman’s office Thursday evening, Reuters and the New York Times reported.

“As part of these negotiations, we are pleased to have received express commitments from the parties that the new company will create a real, well-funded victims compensation fund, implement HR policies that will protect all employees, and will not unjustly reward bad actors,” Schneiderman said in a statement late Thursday.

Contreras-Sweet and her investor group began talks with the studio in the fall. But the deal began to fall apart on Feb. 11, when Schneiderman filed a civil rights lawsuit against Weinstein, his namesake company and his brother and co-founder, Bob. The lawsuit accused Weinstein of “vicious and exploitative” treatment of employees and blamed the film studio for failing to protect his accusers.

The attorney general also condemned Contreras-Sweet’s plan to make the studio’s then-chief operating officer, David Glasser, the head of the company. Glasser, the attorney general alleged, was among the managers who let Weinstein’s misconduct continue unchecked.

On Feb. 16, the studio’s board of directors announced that it had unanimously voted to fire Glasser for “cause,” without offering further explanation.

Contreras-Sweet also increased the victims’ compensation fund to $90 million, including about $30 million in insurance money, the New York Times reported.

Schneiderman appeared satisfied by the investors’ new conditions, but said his lawsuit against the Weinstein Co. remains active.

“We will work with the parties in the weeks ahead to ensure that the parties honor and memorialize these commitments,” Schneiderman said.

More from Morning Mix:

Calif. couple arrested after 3 poorly-fed children found living for years in plywood hovel