Unionized janitors and building workers reached a tentative agreement Tuesday with commercial cleaning companies, ending labor negotiations and avoiding a strike of nearly 11,000 workers throughout the District, Maryland and Virginia.

The office cleaners — members of the Service Employees International Union, who help maintain more than 1,200 office buildings in the Washington area — announced that the group had reached a deal with the Washington Service Contractors Association, which represents the area’s major commercial cleaning companies, hours before their existing agreement lapsed.

For weeks, union organizers have held rallies throughout the region to garner support for workers.

Two marches through rush-hour traffic in downtown Washington this month drew the support of city lawmakers, including D.C. Mayor Muriel E. Bowser (D) and Council Chairman Phil Mendelson (D).

Bowser, who ushered workers into the street with a megaphone in one hand, said the District “cannot move forward without the people that help to make our office buildings work.”

Organizers credited city leaders’ presence at the rallies as instrumental in drumming up support for the workers’ cause.

It wasn’t immediately clear what the contract consisted of, although labor organizers said they would release details by the end of the week.