JOHNSTON, R.I. — Residents in this Rhode Island town say the stench moved in this fall, rolling off the state’s main landfill and spreading its eye-watering fumes for miles.

After weeks of waiting for officials to eliminate the odor, Johnston Mayor Joseph Polisena said he had had enough. He and the Johnston Town Council on Wednesday sued the agency operating the landfill, seeking an immediate end to the odor and damages to compensate for the suffering of residents. He said the smell damages the quality of life in this town of 29,000 just west of Providence.

“The odor has no conscience,” Polisena said. “It travels through different neighborhoods. You can’t measure the effect of this. It has to end.”

The agency in charge of the landfill, the Rhode Island Resource Recovery Corp., has dug dozens of wells to trap the gas and dumped tons of soil to smother the smell. Agency Executive Director Michael O’Connell said he understands the distress the odor has caused.

“There are only a few things you can do to fix an odor problem,” he said during a recent tour of the landfill. “We’re running out of time. We’ll do whatever we have to do.”

The odor can be traced to a number of factors, O’Connell said, including rain that clogged wells that trap the gas. A decision made years ago to open up more landfill space for trash may be to blame as well, he said.

Complaints about the smell have come from as far as Attleboro, Mass., about 20 miles to the northeast. Residents say it often smells like rotten eggs, though it’s also been described as sickly sweet.