LOS ANGELES — A Sriracha hot sauce factory is countersuing Irwindale, alleging the San Gabriel Valley municipality has embarked on a “campaign of harassment” against the company and should pay back $750,000 in fees the firm maintains were voluntarily paid to City Hall.

Huy Fong Foods Inc. filed the countersuit Tuesday in Los Angeles Superior Court. The latest round in the legal battle between Huy Fong Foods and the city comes two years after Irwindale officials dropped the community’s first lawsuit against the company and scuttled a plan to adopt a resolution declaring the factory a public nuisance, based on complaints about odors from the plant.

But on May 25, the city sued Huy Fong Foods again, alleging the company is not abiding by a 2009 agreement in which it pledged to pay $250,000 a year to the city for a decade in lieu of tax payments. The company paid the money the first three years from 2012-14, but failed to pay the next installment in 2015, the suit says. The city is seeking $427,085 in damages.

The factory and the city reached an agreement for Huy Fong to pay the fourth and fifth payments by last November and the sixth installment by January 2017, according to the city’s suit. But the firm notified the city last August that it would not make further what it called “contributions” to the city until a meeting was arranged with “any and all complaining residents that have or have had issues with” Huy Fong Foods, the city’s suit states.

The city responded that the money due involved agreed-upon payments and not contributions, and that it was open to setting up the meeting, but believed the odor issues were not “an outstanding issue.”

However, the company still owes the city the fourth and fifth payments, minus what it paid in business license fees to City Hall, the suit states.

But according to the factory’s countersuit, the city incorrectly sued Huy Fong Foods instead of Huy Fong Irwindale LLC, a separate entity that had entered contracts with the city. The Huy Fong attorneys maintain in their court papers that the fees the city maintains are required of the company are invalid. Nonetheless, Huy Fong Foods voluntarily paid the $250,000 for three years before ceasing such contributions, the countersuit states.

“In the summer of 2014, information was published revealing that (the city) had embarked on a long campaign to impose expensive and unnecessary odor abatement measures on Huy Fong Foods and even to shut down its manufacturing facility,” the countersuit states. “After falling victim to this campaign of harassment at the hands of (the city) … Huy Fong Foods decided not to make further contributions to a city openly hostile to its business interests.”

The company wants a court order either declaring the fees invalid or that other alternative actions be considered by a judge, including a finding that Huy Fong is entitled to a recovery of the $750,000 in previous contributions.

The dispute between the city and the factory began in 2013 after residents complained of a spicy odor that caused headaches, heartburn and watery eyesight.

City officials dropped the first lawsuit after finding that Huy Fong Foods made a written commitment to solving the smell issues. The South Coast Air Quality Management District did not find evidence of a harmful air quality violation.

Huy Fong Foods founder David Tran fled communist Vietnam and originally sold his sauces out of a blue van with a rooster logo he painted himself, the countersuit states. His company gives away $100,000 each year to local residents and visitors with free T-shirts, Sriracha sauce and Sriracha-inspired snacks, according to the countersuit.

“Huy Fong Foods has employed local residents and held job fairs for local workers for the past three years,” the countersuit states. “The factory is a popular tourist destination and brings visitors and revenue into the city – – so popular, in fact, that Huy Fong Foods added two trams to transport visitors around the plant and even opened a gif shop.”

More than 10,000 people attend the factory’s annual open house during chili-grinding season, according to the Huy Fong countersuit.