The Flint Hills Resources oil refinery in Rosemount has agreed to limit the growth of greenhouse gas emissions and curb other air pollution in a deal that removes potential obstacles to its planned $400 million upgrade of the refinery, the company said Tuesday.

Under the agreement reached with two environmental groups, Flint Hills also will contribute $1 million to a Minnesota effort called Project Green Fleet that helps owners of school buses, construction equipment and other vehicles retrofit diesel engines to make them cleaner. Flint Hills is a founding sponsor of the program, and contributed $1 million previously.

The upgrade to the 57-year-old Pine Bend refinery aims to boost its efficiency so that it operates closer to its design capacity of 320,000 barrels per day.

The project, slated to begin next year, would increase the daily construction workforce from about 500 to 1,000 for five years, and add about 100 permanent jobs, said Scott Lindemann, vice president and manufacturing manager for the refinery.

But Flint Hills’ plans faced potential opposition from environmental groups, including the Minnesota Center for Environmental Advocacy (MCEA), a nonprofit environmental law organization based in St. Paul that often intervenes in regulatory matters. That’s because Flint Hills, the state’s third-largest greenhouse gas emitter, needs state regulatory approval to modify its air quality permit to release additional emissions, including those linked to climate change.

Lindemann said the company reached out to the MCEA and the Environmental Integrity Project based in Washington to hear their views on the company’s plan to install energy-efficient technology that also offers some emissions benefits.

“That conversation confirmed we were heading in the right direction,” Lindemann said in an interview.

In the negotiations, Flint Hills agreed to changes in the project to curb the growth of greenhouse gases, although the upgrade still means an increase overall. Flint Hills also agreed to stricter limits on sulfur dioxide and volatile organic compound emissions, and to have an outside party audit its energy efficiency efforts.

Scott Strand, executive director of the MCEA, said his group generally opposes expansion of fossil fuels, especially Canadian tar sands crude oil that partly supplies the Rosemount refinery. He said the agreement addresses an immediate concern.

“Right now we are in a phase where oil refineries around the country are going to be expand, and we have got to deal with the potential impacts of that,” Strand said.

Strand said Flint Hills’ $1 million contribution to the diesel retrofit program will help curb emissions of fine particulates. That could help the Twin Cities avoid violating regional air quality standards and the imposition of federal regulations such as a return of vehicle emissions inspections, he said.

A spokesman for the Minnesota Pollution Control Agency, which is reviewing the permit, said in an e-mail that regulators “so far are fine with what Flint Hills is proposing” and they expect to begin taking public comments on the permit in May or June.