The fire sale of the Weinstein Company hit a last-minute snag on Sunday, when Eric T. Schneiderman, New York’s attorney general, filed a lawsuit against the studio and its fraternal founders alleging that they repeatedly violated state and city laws barring gender discrimination, sexual harassment, sexual abuse and coercion.

The lawsuit, filed electronically in State Supreme Court in Manhattan, appeared timed to at least delay a sale, which had been expected to be finalized on Sunday. If financiers get spooked, Mr. Schneiderman’s move could ultimately kill the proposed deal, putting the Weinstein Company on an almost certain path to bankruptcy.

“Any sale of the Weinstein Company must ensure that victims will be compensated, employees will be protected going forward, and that neither perpetrators nor enablers will be unjustly enriched,” Mr. Schneiderman said in a news release.

The Weinstein Company has been trying to avoid bankruptcy since October, when reports by The New York Times and The New Yorker revealed decades of sexual harassment allegations against one of its founders, Harvey Weinstein. The company was nearing a deal to sell itself to an investor group for roughly $275 million, plus the assumption of $225 million in debt, according to two people briefed on the deal who spoke on condition of anonymity because the negotiations are private.