The months-long food fight raging in Amherst has come to an end – and chalk up a victory for the food trucks.

The popular rolling kitchens will finally be allowed to operate in the region’s largest suburb, eight months after one operator nearly had his truck towed away by the town for serving lunch at an office park.

“It’s not perfect, but we got our foot in the door,” said Mitch Stenger, attorney for the Western New York Food Truck Association.

Town officials Monday unanimously passed new regulations for the growing food truck industry. The rules, which are similar to those in Buffalo, include:

• A $400 fee for each food truck, to be renewed each year for an additional $200.

• A ban on operating within 100 feet of the front door of any restaurant with an open kitchen.

• A three-hour time limit for operation in a public parking space or a commercial area.

• A curfew of 8 p.m. in residential areas and 11 p.m. in public rights-of-way and commercial districts.

The Amherst law restricts trucks from selling their food on residential streets for longer than 20 minutes at a time, as town officials said they did not believe residents wanted them operating there.

“We have a very defined belief that our residential areas are residential, and our commercial are commercial,” Deputy Supervisor Guy R. Marlette said.

Block parties and private functions will be an exception to that rule, provided the trucks stay within residents’ backyards or in the designated block-party areas.

The law reflects months of public debate and private wrangling from both the food trucks and their brick-and-mortar competitors.

Both sides acknowledged they were experiencing what Stenger called “food truck fatigue” after seven rounds of revisions recently left the board without a clear consensus.

But behind-the-scenes negotiations between town officials and the food trucks ramped up, producing a unanimous agreement on the new regulations that seemed unlikely just weeks ago.

“I think our patience has been rewarded,” said Supervisor Barry A. Weinstein.

Meanwhile, food truck operators are pleased that they will be able to sell their burritos, sandwiches and sliders on the bustling Main Street commercial strip – just as the summer restaurant season begins to heat up.

A win in the region’s largest suburb has the food truck owners believing they may make some headway in East Aurora, Hamburg and other pedestrian hot spots that have yet to regulate the trucks.

“I would consider it a win for us because it would set a precedent for other communities that are trying to keep food trucks out,” Stenger said. “Hopefully we won’t have to complete this tedious exercise in every community surrounding Buffalo.”

Marlette said the key to resolving the dispute was finding common ground on the major points and agreeing to work out any other problems later on.

“They didn’t get everything they wanted, and we didn’t get everything we wanted,” he said.