3M Co. has agreed to pay the city of Lake Elmo $2.7 million and give it 180 acres of farmland to settle the city’s nearly decades-old claims that the company’s PFC chemicals contaminated the city drinking water and forced costly fixes.

The settlement with the city, announced late Tuesday, comes 15 months after 3M made history by agreeing to pay the state of Minnesota $850 million to resolve the biggest environmental lawsuit in the state’s history.

Both the state and city lawsuits involve decadeslong allegations that 3M contaminated groundwater in the east metro area when its nonstick, PFC chemicals leaked or leached from tanks and landfills into local water supplies. 3M’s chemicals were used for decades to coat cookware and other products.

The Minnesota Pollution Control Agency and state Department of Health have been investigating 3M’s potential PFC contamination since 2002. The chemicals were first found in drinking water in the eastern Twin Cities in 2004.

It was around that time that several Lake Elmo residents had their water wells tested and found that PFOA or PFOS levels exceeded acceptable limits. Some wells were capped but anxieties rose as the chemicals were also found in some people’s blood.

3M, which stopped producing the chemicals in 2002, has long maintained that the chemicals do not cause any health problems. While 3M stopped producing the chemicals, various versions of the compounds are still made by several other manufacturers. Over the years, the Environmental Protection Agency has lowered the acceptable levels of PFCs deemed safe to humans, a move that only heightened anxieties in affected neighborhoods.

Last year, Kristina Handt, city administrator for Lake Elmo, said the city has many residents who rely on private wells that are still contaminated and it needs to build a distribution system to serve them. The vote to approve the settlement was on the Lake Elmo City Council agenda for Tuesday night.

The agreement settles a lawsuit that had been pending in U.S. District Court for years. The bulk of the money is expected to be used to treat the town’s water supply.

In a statement, officials said the $2.7 million settlement will be credited to a Lake Elmo water account that is used to fund the construction, maintenance and operation of the city’s water system. The open farmland that will be transferred from 3M is located near Lake Elmo’s public works facility.

The city will determine the best use of the land at a later date.

For now, the settlement means that Lake Elmo will drop its lawsuit, said Lake Elmo City Council Member Justin Bloyer.

“We believe this is a fair and equitable settlement for both the city and 3M,” he said. “The city is anxious to put this matter behind us and is looking forward to working together with 3M to ensure safe drinking water for our residents and businesses.”

John Banovetz, 3M’s chief technology officer, said in a statement the company “is committed to working with communities to protect our natural resources” and with Lake Elmo to “help support clean drinking water for city residents.”