In 2007, striking writers carry life-size photos of Marlon Brando and James Dean to express support for members of the Writers Guild of America in Los Angeles. (Damian Dovarganes/AP)

A TV writers’ strike was narrowly avoided Tuesday as screenwriters and producers struck a tentative, three-year agreement.

The previous contract between the Writers Guild of America (WGA) and the Alliance of Motion Picture and Television Producers (AMPTP) expired at midnight Pacific time. Hoping to avoid a strike that would see about 12,000 screenwriters immediately stop working, the two parties negotiated until the early hours of Tuesday morning, the Associated Press reported.

The deal requires ratification by members of the Writers Guild of America.

“The Writers Guilds of America, West and East and the Alliance of Motion Picture and Television Producers have concluded negotiations and have reached a tentative agreement on terms for a new three-year collective bargaining agreement,” the WGA said in a statement.

Details are scant at this time. Both parties held a media blackout during negotiations. However, former WGA president Patric Verrone told The Hollywood Reporter the deal was positive for writers.

Negotiations, mostly concerning health care and compensation, began on March 13. Last month, the WGA voted to authorize their union to call a strike.

Such a strike would have cost the California economy $200 million per week and may have triggered cord-cutting by many television watchers, as a strike’s effects wouldn’t be immediately noticeable on streaming services, which plan their shows further in advance than major networks, according to The Hollywood Reporter.

It would have likely been immediately noticeable in late night comedy television, “where daily or weekly episodes are churned out of New York or Los Angeles, with legions of writers penning jokes, monologues, and elaborate sketches,” The Washington Post’s Elahe Izadi reported.

The last strike spanned 100 days from November 2007 to February 2008, caused many series to have shortened seasons. It also cost the Los Angeles County economy an estimated $2.5 billion, according to the Associated Press.