SAN FRANCISCO (BCN) — A strike was averted Wednesday evening when a union representing thousands of janitors reached a tentative contract agreement with cleaning companies in San Francisco.

Service Employees International Union Local 87, which represents around 3,500 janitors in the city, reached an agreement with the San Francisco Maintenance Contractors Association around 6 p.m. Wednesday in a meeting with Mayor Ed Lee at City Hall.

Union members, who have staged several protests in San Francisco over the past week, voted last Friday to authorize a strike. Their previous contract expired Sunday at midnight.

Union officials said they were successful in obtaining significant raises for members as well as better health care coverage, company contributions to pension funds and a better grievance process.

Perhaps most significant, however, was an agreement by employers to continue using union labor and language providing job security, SEIU Local 87 president Olga Miranda said.

While the union currently represents about 85 percent of the market share, Miranda said some companies have been trying to bring in non-union workers for maintenance.

“We definitely brought down some tech titans in this contract and we’re really happy,” Miranda said.

“Any union job lost in San Francisco is too many,” she added.

The contract, which has more than 20 signatory companies, still must be ratified by union members. Union officials said they hope to hold a vote this week but have not yet set a date and time.