“The ban is illegal, and we expect it to be overturned by the courts,” said Tisha Schuller, the president of the group.

City officials had been bracing for a lawsuit challenging Longmont’s right to make rules for an industry regulated largely by the state and federal authorities. Colorado officials opposed the city’s ban but have declined to sue to overturn it.

Sam Schabacker, one of the ban’s leading advocates, called the lawsuit an attempt to “undermine a democratic vote in order to put a dangerous industrial activity next to homes, schools and public parks.”