The Writers Guild of America announced the deal on Sunday in a joint statement with the Alliance of Motion Picture and Television Producers, which represents the studios, streaming services and production companies in the negotiations.
“WGA has reached a tentative agreement with the AMPTP,” the guild said in an email to members.
“This was made possible by the enduring solidarity of WGA members and extraordinary support of our union siblings who joined us on the picket lines for over 146 days.”
The agreement came after five days of renewed talks between the two sides. It was approved by more than 90 per cent of union members.
The terms of the agreement have not yet been made public, but in a statement, President Joe Biden said it included assurances related to artificial intelligence.
The agreement “did not come easily”, he said in a statement.
“There simply is no substitute for employers and employees coming together to negotiate in good faith towards an agreement that makes a business stronger and secures the pay, benefits and dignity that workers deserve,” the President said.
The primary driver behind the strike is how writers' pay is affected by streaming services. Writers also went on strike over the size of writing staff, as well as the use of AI in scriptwriting.
Hollywood writers went on strike on May 2 for the first time since 2007, and were later joined by actors fighting for higher pay in the era of streaming services.
It was the first time the writers' and actors' unions had gone on strike together since 1960.
The strikes, which have meant many top names in Hollywood have been unable to promote new shows and films, have also affected box office revenue.
The Emmy Awards were also postponed from September to January.
But the agreement means that nightly programmes such as NBC's The Tonight Show Starring Jimmy Fallon could return to air soon. Fallon and other late-night hosts expressed solidarity with writers when the strike was first announced.
In a longer message from the guild shared by members on social media, the writers were told the strike is not over and no one was to return to work until hearing otherwise, but picketing is to be suspended immediately.
It said more details would be released after “contract language” has been finalised.
Stand-up comic and creator of Netflix's The G Word Adam Conover celebrated the announcement.
“Over the coming days, we'll discuss and vote on it, together, as a democratic union,” he said.
“But today, I want to thank every single WGA member, and every fellow worker who stood with us in solidarity.”
Actor Mark Ruffalo also celebrated, writing on X, formerly Twitter: “Bravo! WGA proves when we fight we win.”
But with the actor's guild still on strike, the agreement that writers had reached with AMPTP does not mean Hollywood will return to business as usual just yet.
The Screen Actors Guild-American Federation of Television and Radio Artists congratulated its “fellow union siblings” on reaching a tentative agreement with production companies.
“We applaud your dedication, diligence and unwavering solidarity over the last 5 months, and are proud to stand shoulder to shoulder with you as creative partners in the entertainment industry,” Sag-Aftra said in a statement.
The union's negotiating committee said it remains ready to resume its own negotiations when production companies “are prepared to engage on our proposals in a meaningful way”.
“Until then, we continue to stand strong and unified,” it said.
Los Angeles Mayor Karen Bass issued a statement congratulating the two sides on the deal and said she is hopeful the same can happen soon with actors.