Members of a union at Bath Iron Works voted Saturday in favor of a new contract with the shipbuilder, averting a potential strike planned for Monday.

BIW officials said the company is pleased to have an agreement, and Kirk Douglass, president of the local union, the Bath Marine Draftsmen’s Association, said the vote was a positive step.

“It is good we are going to go back to work,” said Douglass.

The vote in favor of the contract was 414-117, or nearly 78 percent. The contract takes effect Monday and runs until March 20, 2022.

Douglass said the union is giving up some of its flex time benefits, a provision that allows members to determine within a certain range their start and end times each day. Flex time had been the sticking point in the contract negotiations, but any changes won’t go into effect for six months, rather than the three months the company wanted.

The union and the shipbuilder had been working with a federal mediator since Wednesday, trying to reach a compromise on a new contract for the union’s roughly 760 members. They reached a tentative agreement late Friday, which union members voted on Saturday morning in Brunswick.

“While we recognize that this tentative agreement is not perfect, and it’s not what any of us wanted when we entered into these negotiations, we believe it represents a significant improvement from what we were facing last week,” read a letter posted on the union’s Facebook page just before midnight Friday. “It has good economics and preserves a level of workplace flexibility that would otherwise have been eliminated.”

An initial contract was voted down last Sunday.

The new 4½-year contract will give workers two pay increases totaling 5.6 percent, $6,000 in lump sum payments, and more retirement benefits and paid time off.

The new contract does retain some flex time benefits, which allow employees to vary when they arrive at and leave work during a 40-hour week. Workers said flex time makes it possible for them to care for sick family members since they lost 23 days of sick leave and vacation time in the last contract in 2013, The Associated Press reported.

Union leadership applauded members’ solidarity, which was reflected in their wearing certain colors on specified days, social media campaigns and lobbying of elected officials.

“Thanks to the membership’s strong showing of solidarity and clear determination, the company moved to a position that is much more closely aligned with the BMDA proposal made available last week,” the union leadership said in its post.

The local union represents materials testers, laboratory technicians and employees who work on ship designs and technical drawings. Its membership represents about 13 percent of the shipyard’s workforce of 6,000.

The last strike at the shipyard was a 55-day walkout in 2000.

The draftsmen’s association is an affiliate of the United Automobile, Aerospace and Agriculture Implement Workers, Local 3999.

The draftsmen’s association had the support of the Local S6 chapter of the Industrial Union of Marine and Shipbuilding Workers of America, the largest union at the shipyard with about 3,600 members.