It was a cliffhanger ending, but the Writers Guild of America and the studios have reached a new deal that will keep the scripts coming and Hollywood at work.
The threat of the first strike in a decade was averted after a marathon negotiating session that went past the midnight deadline, leaving much of Hollywood staying up late and checking social media, looking for hints as to whether there would be picket lines on Tuesday.
The parties issued a joint statement confirming the new three-year agreement.
RELATED: TV shows that will end in 2017 (photo gallery)
In a memo to its membership, guild negotiators cited several key concessions, including increased studio contributions to their health plan, and a new definition for short-order TV series that will earn writers more pay for episodes that take longer than 2.4 weeks to produce.
The new contract also adds job protections for members on parental leave.
"Did we get everything we wanted? No. Everything we deserve? Certainly not," the WGA memo added.
A crippling writers' strike in 2007 brought scripted production to a screeching halt and dealt a significant blow to California's economy; still, the latest talks between the studios, represented by the Alliance of Motion Picture and Television Producers, and the WGA came down to the wire. Their existing agreement was set to expire at the end of the day on Monday.
Writers had been pressing a number of key demands, including the larger contributions to their health care plan.
For consumers, the immediate effects of a strike would have been visible first in late-night television, sidelining programs hosted by Jimmy Fallon, Stephen Colbert, Samantha Bee, and Jimmy Kimmel, among others.
The WGA cited massive studio profits as justification for the contentious negotiations, pointing to lavish CEO salaries as proof that writes merely deserved their fair share.
In just the last few weeks, for example, it was reported that CBS Chief Leslie Moonves received a pay bump that brought his 2016 compensation to $69.6 million. NBC Universal's Steve Burke took home $46.1 million in 2016 and AMC Networks' Josh Sapan enjoyed a hefty $30.5 million last year, which amounts to a 72% raise.
The writers overwhelmingly voted last month to authorize a strike, giving their the leadership the leverage they hoped they would need to secure a more favorable deal. Still, many writers noted that they were voting for a strike with the hope it wouldn't come to that.
The WGA negotiating committee included notable writers like Damon Lindelof ("Lost"), Jonathan Nolan ("Westworld"), Amy Berg ("Leverage") and Beau Willimon ("House of Cards").
"WGA MEMBERS: Thank you for your trust, your patience, and your heart," Berg tweeted early Tuesday.
The WGA is one of three major talent guilds with which the studios must negotiate. The Directors Guild of America hammered out a separate deal late last year and talks with the Screen Actors Guild are expected to begin later this month.
Although certain aspects of the guild agreements overlap, each has their own individual concerns that can complicate the negotiations.
While the major studios are large enough to weather a strike for a while, there were incentives to avoid it. Among the most pressing are this month's upfront presentations, when TV networks unveil their fall program lineups to advertisers.