Hollywood producers and labor leaders narrowly averted a strike that would have shuttered production across the country, agreeing on Saturday to a new contract that guarantees production workers meal breaks, weekends and breaks between shifts.

IATSE, the International Alliance of Theatrical Stage Employees, a union representing workers such as camera operators, makeup artists and editors, said it had reached an agreement Saturday with the Alliance of Motion Picture and Television Producers (AMPTP), a group representing major producers including Walt Disney Studios, Paramount Pictures, Netflix and Amazon.

The new agreement, which will need to be ratified by union members, includes mandatory 10-hour break periods between shifts and a 54-hour weekend. Workers had raised issues with work bleeding into evenings and weekends. The agreement covers about 40,000 union members on the West Coast; members in local unions in other parts of the country will need to pursue a separate agreement.

A large majority of IATSE members — 98.6 percent of the 90 percent who voted — moved two weeks ago to authorize the strike of 60,000 workers, which was set to start Monday at 12:01 a.m. if an agreement was not reached. A strike in 2007 among television and film writers lasted for 14 weeks, tanking ratings.

IATSE President Matthew Loeb hailed the agreement as a “Hollywood ending” for its members.

In an email sent to members on Saturday, the union celebrated 3 percent annual wage increases, mandated rest periods, diversity, equity and inclusion initiatives, and a “living wage achieved.”

But reaction among workers was mixed, casting uncertainty over whether the agreement would be ratified, with some criticizing what they said was a lack of progress from previous contracts.

An Instagram account for IATSE members to gather and share struggles of their long hours and other problems in the industry was flooded on Saturday night with comments that the agreement did not go far enough, particularly in protecting workers from long workdays.

Allyson Greven, 27, is a set costumer and union member in Los Angeles who said she would vote no on ratifying the agreement. The break periods set by the agreement are already in place for her costumers’ union, she said, adding that she was disappointed that the agreement did not appear to fix the problem of low pay and long hours.

Greven said she often works 12 hours or more, with long commutes — sometimes as long as two hours. Some days, workers are told that there won’t be a lunch break, she said, adding that she was not optimistic that penalties for production companies that don’t offer meal breaks would mitigate that issue.

“You never have time to eat,” she said. “You barely have time to go to the bathroom during the day when you’re shooting. It’s ridiculous.”

Mike Miller, IATSE’s vice president, said with the agreement, “workers should have improved morale and be more alert,” adding that “health and safety standards have been upgraded.”

IATSE said in a statement before the strike vote that the group of producers had not spoken with the union’s bargaining team for two weeks. The pending strike hastened the talks, it said. And on Friday night, “they caved,” a senior IATSE official, who spoke on the condition of anonymity to discuss details of the negotiations, told The Washington Post.

The agreement also includes a minimum $20 hourly wage, a 25 percent increase for the lowest earners, the official said.

It also contains “improved wages and working conditions for streaming,” IATSE said. Workers had raised concerns that streaming services paid lower wages and had longer hours than traditional production companies, and that they contributed less to pensions and health-care plans.

Many workers in Hollywood television and film productions are not salaried employees of one production studio but function like gig workers, going from project to project with different companies.

Greven said that she hadn’t worked for a streaming service’s show in a “very, very, very long time" because she wanted to avoid the lower rates.

Apple, for example, had asked to pay workers a discounted rate because it has fewer subscribers than other streaming services. But, workers noted, its show “Ted Lasso” won several awards at the Emmys last month.

IATSE members will receive the details of the agreement in the coming week before a ratification vote is held online. The union, in its message to members, said it was “currently working out the details” of the process to ratify the agreement.