Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

It went beyond the deadline but the Writers Guild of America and the Alliance of Motion Picture and Television Producers came to terms on a new contract early Tuesday, defusing the threat of a strike crippling the film and television industry.

The sides shook hands 90 minutes after the previous contract expiration deadline passed. The WGA had vowed to strike Tuesday if a deal was not in place.

The guild's instant "pencils down" policy had meant that shows that work on a quick-turnaround — notably day-time soap operas and late-night talk programs like "The Tonight Show Starring Jimmy Fallon," "The Late Show with Stephen Colbert" and "Jimmy Kimmel Live" — would be out of topical material immediately.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

If ratified by its members, the tentative deal will cover its television and film writers for three years. It addresses health care issues, parental leave and overtime payment among other sticking points.

Thousands of Writers Guild of America writers and others during a strike in 2007. Reed Saxon / AP file

Pickets could have started immediately, sending late-night talk shows into reruns and eventually impacting scripted series and feature films in development.

The previous writers' strike occurred nearly 10 years ago and gradually took a wider toll on Hollywood TV and movie production and the California economy.

"Your negotiating committee is pleased to report that we have reached a tentative agreement with the AMPTP that we can recommend for ratification," the WGA told members in a memo early Tuesday. "In it, we 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."

Both sides had been negotiating for the past week with a looming deadline of midnight local time (3 a.m. ET) Monday, when the writers' current contract expired. A strike would have required nearly all of the WGA's 13,000 members to stop work immediately — hitting late-night talk shows, daytime soap operas, and "Saturday Night Live," and disrupting upcoming TV series and films.

Negotiations for the new contract began on March 13 and broke off twice. The WGA repeatedly pointed to its calculation that the six major entertainment conglomerates generated $51 billion in operating profits during 2016 — including that figure in an April 28 message to members, estimating that it would cost employers $156 million annually to increase payments to writers under its proposal to production companies.

If the WGA had walked out, it would have been the guild's seventh strike since 1960. The most recent strike was an acrimonious 100-day work stoppage, fueled by the WGA's demand for new media residuals and jurisdiction. That strike started Nov. 5, 2007, and ended Feb. 12, 2008.

NBC News' parent company, NBCUniversal, is a member of AMPTP, the trade group representing film studios and the TV networks during discussions with the WGA.