The IATSE Basic Agreement ratification passed on Monday by the narrowest of margins, with a few hundred votes in two guilds deciding the outcome.

A bare majority of the 40,000-odd members of the 13 West Coast locals voted to reject the agreement — with 50.4% voting no and 49.6% voting yes. But the union’s contracts are ratified based on a delegate system, with delegates awarded based on the majority vote within each local.

By that measure, the contract was approved by a vote of 256 to 188. This is the first time in 32 years that an IATSE contract has been ratified despite being rejected by the majority of voters.

Two of the three largest locals — Local 44 and Local 700 — voted in favor of the agreement by close margins. If either had voted no, it appears the contract would have been rejected, and negotiations would have to start over from scratch — with a real possibility of a nationwide film and TV strike.

IATSE Local 44 represents propmakers, set decorators and special effects employees. The membership voted to ratify by a margin of 400 votes, with 2479 in favor and 2079 against, or 54.4% to 45.6%, according to an email shared with members.

The margin was even closer in the Motion Picture Editors Guild (Local 700), which voted to reject the Basic Agreement three years ago. In that guild, the contract was approved 51.9% to 48.1%. The local did not release a raw vote tally, but did disclose that 7,093 members voted (representing 82.2% turnout), which gives a margin of about 270 votes.

IATSE has not released a delegate breakdown, but each local is awarded roughly one delegate for every 100 members. Based on the eligible vote totals, it appears that if either Local 700 or Local 44 had voted “no,” the Basic Agreement would have fallen well short of the 223 delegates needed for approval.

The contract was narrowly rejected by the third big local, the International Cinematographers Guild, Local 600. In that union, 52.1% voted no and 47.9% voted yes, with a margin of 270 votes and a total ballot count of 6,398.

The contract was unusually contentious, as many members urged a “no” vote because they believed it did not do enough to address long hours on set and a lack of meal breaks, among other issues.

“Our members want quality-of-life issues improved, and we did it but they’re going to want more,” said Scott Bernard, business representative of Local 695, which narrowly voted for the agreement. “I think the producers are going to get the message the members still want more. They want safer hours and safe sets.”

Of the 13 Basic Agreement locals, eight voted to ratify: 44, 695, 700, 706, 729, 800, 871 and 884. The other five rejected the deal: 80, 600, 705, 728, and 892. The vote of each local union was confirmed by a combination of members and local leaders.

The vote was also extremely close on the Area Standards Agreement, which was ratified by a delegate tally of 103 to 94. The ASA covers about 20,000 workers in 23 locals around the country, including in production hotspots like Louisiana, Georgia and New Mexico. 14 of the 23 locals voted yes, and the other nine voted no. The contract did win a majority of ASA voters, 52% to 48%.

Updated with more precise figures for Local 600.