SEATTLE – Seven national fast-food chains have agreed to end policies that block workers from changing branches — limiting their wages and job opportunities — under the threat of legal action from the state of Washington.

Washington Attorney General Bob Ferguson announced binding agreements with the companies — McDonald’s, Auntie Anne’s, Arby’s, Carl’s Jr., Jimmy John’s, Cinnabon and Buffalo Wild Wings — at a news conference Thursday. McDonald’s had previously announced plans to end the practice.

The so-called no-poach policies prevent franchises from hiring workers away from other franchises of the same chain. That’s been considered convenient for franchise owners, but has blocked experienced workers at one franchise from getting better-paying jobs at others, potentially keeping tens of thousands of employees around the country stuck in low-wage positions.

Without access to better job opportunities at other franchises, workers have less leverage to seek raises in their current positions, Ferguson said.

“Our state antitrust laws are very clear: Businesses must compete for workers the same way as they compete for customers,” Ferguson said. “You can’t rig the system to avoid competition.”

In separate agreements filed Thursday in King County Superior Court in Seattle, the companies denied that their policies are illegal, but said they wanted to avoid expensive litigation.

Ferguson credited them for quickly agreeing to end the practice nationwide in response to his legal threats and said fast-food chains that don’t follow suit will be sued. The seven chains have more than 500 locations in Washington.

On Monday, a coalition of 11 Democratic state attorneys general, led by Maura Healy of Massachusetts, announced a separate investigation into the no-poach agreements at several chains, including Arby’s, Burger King, Dunkin’ Donuts, Five Guys Burgers and Fries, Little Caesars, Panera Bread, Popeyes Louisiana Kitchen and Wendy’s.

Ferguson said his office began investigating early this year, prompted by a New York Times article detailing how such policies had stifled wages for fast-food workers.