New York Attorney General Eric Schneiderman filed a lawsuit against Harvey Weinstein and his former company, a move that complicates the sale of the disgraced mogul's film studio.

Schneiderman said Sunday that a four-month investigation into sexual harassment found "vicious and exploitative mistreatment of company employees." The suit cites what it calls "egregious" violations of state civil and human rights laws.

The suit also names Weinstein's brother Bob, with whom he co-founded The Weinstein Company. It was once one of Hollywood's most powerful film studios.

The complaint alleges "a years-long gender-based hostile work environment, a pattern of quid pro quo sexual harassment, and routine misuse of corporate resources for unlawful ends."

The alleged misconduct began in 2005 and continued through about October 2017, the suit claims.

Weinstein attorney Benjamin Brafman said in a statement that "a fair investigation by Mr. Schneiderman will demonstrate that many of the allegations against Harvey Weinstein are without merit."

"While Mr. Weinstein's behavior was not without fault, there certainly was no criminality," the statement reads.

Related: Scandal sparks movement in Hollywood and beyond

The suit comes at a critical time for The Weinstein Company. Schneiderman said that any sale must ensure that victims are compensated.

According to the complaint, a sale could "enable perpetrators or enablers of misconduct to obtain unwarranted financial benefits and fail to protect" employees.

Last month an investment group led by Maria Contreras-Sweet, former head of the U.S. Small Business Administration, began exclusive negotiations for the company's assets, a person with knowledge of the talks told CNN.

A deal would have averted a bankruptcy auction, which was thought to be a likely outcome.

On Sunday, a source close to the deal said Contreras-Sweet was "stunned and disappointed" at Schneiderman's lawsuit.

The source said the suit "effectively killed this deal" and pointed out that Contreras-Sweet has "stated publicly since November her deal's central goal was to launch a female controlled movie studio...and create a real compensation fund for victims."

In response to the source's comments, Amy Spitalnick, a spokesperson for Schneiderman, said takeover terms reviewed by attorney general's office did not include a dedicated victims' fund or guarantee all-female management.

"We expressed to them how important it is that any deal adequately compensate victims, protect employees, and not reward those who enabled or perpetuated this egregious sexual misconduct," Spitalnick said in a statement. "We were surprised to learn they were not serious about discussing any of those issues or even sharing the most basic information about how they planned to address them."

The film studio had been seeking a buyer for several months.

Weinstein was ousted from his role at The Weinstein Company last year after numerous reports of sexual misconduct. He has been accused of sexual harassment or abuse by more than 60 women. Weinstein has denied any accounts of non-consenusal sex.

Schneiderman's lawsuit accuses Weinstein of "personally creating a hostile work environment ... by demanding that women engage in sexual or demeaning conduct."

He routinely yelled at female employees "for purported incompetence, cursing in their faces, threatening to end their careers, and describing his intent to harm them," the suit alleges.

It also claims Weinstein used derogatory and obscene language to intimidate employees.

The suit also alleges that Bob Weinstein was aware of Harvey Weinstein's behavior and failed to maintain "a safe workplace free of sexual harassment and other unlawful conduct," and the studio failed to adequately respond to formal complaints against Weinstein.

In his statement, Brafman, Weinstein's attorney, said he believes Schneiderman's inquiry will prove that "Weinstein promoted more women to key executive positions than any other industry leader and there was zero discrimination" at his companies.

"If the purpose of the inquiry is to encourage reform throughout the film industry, Mr. Weinstein will embrace the investigation," Brafman said. "If the purpose however is to scapegoat Mr. Weinstein, he will vigorously defend himself."