The union representing 14,000 New England janitors reached a tentative agreement with a consortium of cleaning companies early Monday morning, averting a threatened strike.

Workers had authorized a strike if a deal was not reached before the contract expired at midnight on Sunday. Negotiators extended the deadline by several hours, agreeing on the tentative pact at about 2 a.m. Monday.

The four-year agreement with the Maintenance Contractors of New England increases the number of full-time jobs — the major demand of Service Employees International Union Local 615 — from about 4,600 to more than 5,200 in Greater Boston, an increase of at least 680. Currently, two-thirds of the union members work fewer than the 30 hours a week required for health insurance.

On top of the 680 additional full-time jobs, buildings of more than 450,000 square feet constructed after the contract is ratified in the Boston and Cambridge area will be staffed by full-time workers. Within four years, 60 percent of the janitorial work at office buildings larger than 450,000 square feet in Greater Boston will be done by full-time workers, according to the union. Currently, 20 percent of that work is full time.

The contract, which covers workers at The Boston Globe, also increases wages 12 to 13 percent over four years, raising hourly pay for Boston area workers to $17.85 an hour by the end of the contract. It creates a minimum four-hour shift for janitors working in buildings bigger than 100,000 square feet, eliminates the probationary period for workers with more than a year of service when a building changes cleaning companies, and forms a watchdog group funded by labor and management to expose unfair employment practices by nonunion companies.

Starting in the second year of the contract, workers will earn one paid personal day per year. The agreement also includes a process that allows janitors, many of whom are asked to clean hundreds of offices per shift, to file grievances about excessive workloads.

“For years, corporate profits have been growing at the expenses of workers’ wages and benefits,” Rocio Saenz, president of Local 615, said at a press conference Monday. “It is by victories like this that we rebuild the middle class.”

Matt Ellis, spokesman for the janitorial companies, said the union settled for wages and benefits that were less than what it was seeking, allowing the companies to avoid layoffs.

“We came to an agreement that’s fair to both sides,” Ellis said.

Silvia Clarke, 61, has been working 19.5 hours a week scrubbing and vacuuming an office building in Lowell, sometimes in 3.5-hour shifts. With the new contract, she will be guaranteed four-hour shifts, which will push her above the 20 hours a week she needs to qualify for the pension benefit. “I’ve been begging them for that extra half an hour,” said Clarke, who is part of the union bargaining committee.

Governor Deval Patrick applauded the union and the contracting companies for reaching what he called a “fair and just” agreement that will allow janitors to share in business owners’ prosperity. The workers, he said in a statement, “will now have a pathway to the middle class and an opportunity to partake in the American Dream.”

Union members will vote on the contract later this week, with the votes to be counted on Saturday.