The township of Delran has agreed to accommodate nearly 200 new units for low- and moderate-income residents, ending one of the more contentious battles over affordable housing in New Jersey.

The Burlington County township on Tuesday night agreed to settle its long running legal battle with the Fair Share Housing Center, a Cherry Hill-based nonprofit that has tussled in court with municipalities across the state to enforce affordable-housing requirements under the Mount Laurel doctrine.

"We're very happy with this agreement," said Anthony Campisi, spokesman for Fair Share. "It ensures that shovels get in the ground quickly to build affordable units," including on the former Stellwag Farm site, which had been slated for development without affordable housing before advocates intervened.

"It could have been much worse. I feel that what we ultimately negotiated is much better than we had hoped for," said Gary Catrambone, Delran council president.

Delran is "a particularly important town," given its proximity to employment in Philadelphia, Campisi said. It had been one of the largest Burlington County towns yet to settle.

About 250 municipalities statewide have reached similar settlements over their obligations to plan and zone for affordable housing, which stem from a lawsuit brought in the 1970s over lack of such housing in Mount Laurel.

In that landmark ruling and others, the New Jersey Supreme Court decided that every municipality must provide its "fair share" of affordable housing. But turning the concept into reality has been a battle.

After years without enforcement of the mandates by the state, the court stepped in, ruling last year that municipalities had to meet housing obligations that had accrued over the past 16 years. But the justices didn't specify just how much housing each municipality would have to provide. Instead, the question has been hashed out town by town in the lower courts.

In Delran, officials had argued the township had limited room for housing; advocates claimed it was trying to skirt its obligations.

In the settlement, which still must be approved by a judge, the township and Fair Share agreed Delran would have had to allow 365 affordable-housing units to be built between 1999 and 2025.

Only 196 new units are planned: Delran can meet some of the need through an existing housing complex and was awarded bonus credits for certain plans.

The agreement includes one development of entirely affordable housing near Route 130, as well as developments of mixed market-rate and affordable housing on Chester Avenue by Delran Middle School and off Route 130. Delran also agreed to convert 10 market-rate units into affordable units.

"This will build out any remaining large parcel as it sits right now," Catrambone said.

Other area towns that have settled include Moorestown, as well as Cherry Hill, Medford, and Mount Laurel. Across Burlington, Camden and Gloucester Counties, 37 municipalities have settled, while 23 haven't, including Haddonfield, Mount Holly, and Washington Township in Gloucester.

Fair Share also on Wednesday secured an agreement with affluent West Windsor Township in Mercer County, though neighboring Princeton has yet to settle.

Correction: A previous version of this article misstated when the settlement was approved.