UPDATED with WGA statement, details of deal: After a day of twists and turns, Hollywood has dodged a bullet. A threatened writers strike was averted early this morning when the WGA and management’s AMPTP reached a tentative agreement on a new three-year film and TV contract after the old contract had expired at midnight PT.

The deal now goes to the WGA West’s board and the WGA East’s council for approval, and then to the guilds’ members for ratification.

In a statement from the WGA negotiating committee (read it in full below), the guild said writers made gains “in minimums across the board — as well as contribution increases to our Health Plan that should ensure its solvency for years to come. And we further expanded our protections in Options and Exclusivity.

“We also made unprecedented gains on the issue of short seasons in television, winning a definition (which has never before existed in our MBA) of 2.4 weeks of work for each episodic fee. Any work beyond that span will now require additional payment for hundreds of writer-producers.

We won a 15% increase in Pay TV residuals, roughly $15 million in increases in High-Budget SVOD residuals, and, for the first time ever, residuals for comedy-variety writers in Pay TV.

And, also for the first time ever, job protection on Parental Leave.”

In all, the WGA said the deal will net the guild’s members “$130 million more over the life of the contract.”

A short email that was sent out to union captains after the deal was reached says “more details to follow,” and that there will be a May 4 meeting at WGA headquarters with the negotiating committee to go over the agreement.

The AMPTP was expected to release a statement shortly.

“It’s the art of the possible. We did the best we could,” said the WGA’s chief negotiator David Young, coming out of the AMPTP’s Sherman Oaks offices close to 1 AM Tuesday after an all-day and all-night bargaining session. “It’s got some important new things in it, and an important old thing: the health plan has been taken care of.”

Said Patric Verrone, former WGA president and member of the negotiation committee: “I think they made a very good deal. I think the membership is going to be very happy.”

The news comes after negotiations continued past the three-year film and TV contract’s midnight PT expiration. But sources on both sides said they were close on a new agreement, with the continuing talks proving “constructive.” By 12:45 AM, people inside and around the building were seen embracing and smiling.

“It was a hard night, but we knew it would be,” a source close to the studios told Deadline of the hours leading up to the early-morning deal.

It’s a major victory for the guilds, their leadership and their members, who made it abundantly clear over the last few months that they were ready and willing to strike if they didn’t get what they wanted – a fair deal.

It’s also a big win for late-night talk and comedy shows, which would have been the first to feel the brunt of a writers’ walkout. It’s also a big win for their viewers, who won’t be subjected to a steady diet of Trump jokes written by interns and production assistants.

It’s a win for the networks and advertisers, too, in advance of their upfronts, which get underway May 15 and deals can now be made without the uncertainties of a strike clouding the picture.

Hollywood can now breathe a collective sigh after holding its breath ever since contract talks began March 13 amid a flurry of strike threats. But it’s only a temporary breather. Negotiations for a new SAG-AFTRA contract will get underway later this month, and the industry could be in for another round of apnea.

Here’s the WGA’s full statement: