TV fans can breathe a sigh of relief – the threatened strike by the writers' union has been averted following a tentative agreement was reached with Hollywood studios and TV networks.

The two sides announced a tentative, three-year deal after a long day of negotiations and a little over an hour after the expiration of the previous agreement.

Both parties issued a short joint statement at about 1.30am PT (9.30am GMT). It said: "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 Writers Guild (WGA) represents film and TV writers, while the AMPTP negotiates on behalf of studios and networks, and the two sides had been holding contract talks in recent weeks in an effort to reach a new deal before the expiration of the previous agreement.

Talk show hosts such as Stephen Colbert (pictured here with Liam Neeson) would've been among the first TV casualties had the writers gone on strike

As talks were being held in Los Angeles, both sides operated under a self-imposed media blackout.

A vast majority of WGA members recently gave their union negotiators authorization to call a strike if no deal were reached by the time the contract ends, meaning writers could have been walking picket lines as early as Tuesday.

If that had happened, viewers likely would have first noticed the effects of a strike with that evening's late-night talk shows, where the likes of Stephen Colbert, Jimmy Fallon and Jimmy Kimmel depend on writing staffs for topical monologues and sketches.

There had been fears of a repeat of the previous strike, when WGA members took to the pickets in 2007-08, which is estimated to have cost the California economy a massive $2 billion.

Hugely popular shows such as The Big Bang Theory and Breaking Bad were affected as their seasons were cut short.

Contractual issues included the level of studio and network contributions to the writers’ health plan and the level of compensation for TV writers in an industry affected dramatically by changes in technology, distribution and viewing habits