Maryland lawmakers have hashed out a compromise to reduce phosphorus on its part of the Delmarva Peninsula, a move that could lead other states to do the same and slowly clean up the rivers flowing into the Chesapeake Bay.

Wednesday night, environmentalists and government officials announced that they were moving forward with new regulations that control the amount of phosphorus farmers are allowed to spread on land.

Under the compromise, farmers will have to implement the new phosphorus management tool in 2024 instead of 2022, which was already a delay of several years. The tool regulates how much phosphorus can be apply based on how much of the nutrient is already in the soil, and how likely it is to reach waterways.

In exchange, Gov. Larry Hogan removed what environmentalists called a “get out of jail free card” that would have allowed for indefinite delays in implementing the tool. The compromise also strengthens the duties of a committee set up to advise the Maryland Department of Agriculture on how to handle excess litter and encourages farmers to reduce phosphorus on some of their fields earlier than required if they are able to do so.

Environmental advocates say the phosphorus management tool represents one of the best opportunities to tackle the Eastern Shore’s growing poultry waste problem. Maryland’s part of the Delmarva Peninsula grows more than 300 million birds a year. Much of their litter is applied to fields to grow corn and soybeans that will feed those chickens.

But the farmers generally apply the manure based on the crops’ nitrogen needs. That often results in the application of far more phosphorus than the plants can absorb. The excess builds up in the soil and runs off the land in rainstorms or seeps into the groundwater. It’s the main reason why the Eastern Shore receives nearly twice as much nitrogen and phosphorus per square mile of land as any other part of the watershed, according to a recent U.S. Geological Survey Report.

Doug Mayer, spokesman for. Hogan, praised the various groups for hashing out the compromise. Among those involved: The Chesapeake Bay Commission, the Maryland Department of Agriculture, the Chesapeake Bay Foundation, farm industry trade groups, and a coalition of environmental groups known as the Maryland Clean Agriculture Coalition.

“The Hogan administration has worked closely with the agricultural and environmental communities as well as legislators to find a balanced plan for limiting phosphorus, and we are pleased that all sides are on board with this approach,” he said. “There has always been agreement on the problem: There’s too much phosphorous, nitrogen and sediment entering the Chesapeake Bay. Now we have agreement on a solution that represents one of the most important steps forward in environmental policy in last decade.”

The regulation will be printed in the Maryland Register April 3.

“We’re on a schedule to get there by 2022, however, the regulation provides for two one-year delays if in fact those capacities are not in place, and provides a date certain, by 2024,” said Royden Powell III, assistant secretary of the office of resource conservation, Maryland Department of Agriculture.

The deal came after three years of delays and arguments over the phosphorus tool, which assigns farm fields a fertility index value based on a variety of factors. If a farm scores below 150, farmers can apply manure. But if it scores above 150, they must use the tool to determine how much phosphorus, if any, they can apply. For the past decade, Maryland farmers have been using a different technique called the phosphorus index. Under Maryland’s index, farmers could offset high levels of phosphorus with buffers or cover crops and continue to apply manure. But under the phosphorus management tool, when their soil hits the limit, they can apply no more.

When he was governor, Martin O’Malley attempted three times to put in a phosphorus management tool. He pulled it back because of farmer opposition. Since 2013, farmers have complained that the science wasn’t settled; that implementing the phosphorus management tool would amount to economic hardship; and that they had no options for disposing of the manure. O’Malley pushed the regulations forward just before leaving office. Directly after his inauguration in January, Hogan pulled the phosphorus management tool from the Maryland Register, where it was on its way to being printed.

After Sen. Paul Pinsky introduced legislation that mimicked O’Malley’s phosphorus management tool, Hogan countered with a proposal of his own. It gave farmers an extra year, so the PMT would have to be fully implemented by 2022. It also committed to finding alternative uses for the manure. Hogan’s plan also called for an immediate end to applying phosphorus on the fields with the highest levels of phosphorus.

A state-mandated study found that implementing the tool could cost between $22 million and $52 million. Most of the cost is generated by the need for farmers to buy commercial fertilizer that doesn’t contain phosphorus to replace manure. Environmentalists argued those numbers didn’t take into account the benefits of a clean Chesapeake Bay, and that the cost based on fertilizer purchases could be less.

Farmers said that they could live with Hogan’s proposal.

“Certainly, we’re not saying we don’t have a problem. We’re just trying to come up with some logical solutions,” said Lee Richardson, a Wicomico County chicken farmer who also farms 2,000 acres of grains and has some fields where he wouldn’t be able to apply chicken manure when the tool becomes law. “It’s inevitable, and we understand that, but we’re trying to do it with common sense.”

The Maryland Clean Agriculture Coalition and the Chesapeake Bay Foundation issued a joint statement Wednesday praising the compromise.

“Our organizations would have liked to have begun using the phosphorus management tool four years ago, as Maryland promised, and as the science dictated. Nevertheless, these revised regulations represent progress toward reducing pollution from agriculture —– which we absolutely must do to protect the Chesapeake Bay and local waterways, as well as public health.”

Ann P. Swanson, executive director of the Chesapeake Bay Commission, an advisory panel that represents the legislatures of Maryland, Pennsylvania and Virginia, said earlier this week that she was confident the sides would reach a deal because they had never been so close.

“Not so long ago, people were saying there was no science, there was no problem that we had ample capacity to deal with the manure, that our soils were not saturated,” she said. “Now, all sides recognize that we need to change the way we do things. That is phenomenal progress.”