In this file photo from 2010, players march onto the field for introductions before the Maryland 4A girls' soccer semifinal at Richard Montgomery High School in Rockville. (Doug Kapustin/For The Washington Post)

Three Montgomery County schools will get new artificial turf athletic fields as part of a legal settlement that will provide field access to the county’s largest recreational youth soccer organization.

Montgomery school officials announced the agreement Thursday, saying Montgomery Soccer Inc. will contribute as much as $5.2 million toward the construction of fields at Walt Whitman High School, Albert Einstein High School and Julius West Middle School.

In return, MSI, a nonprofit with more than 900 teams and nearly 15,000 youth players countywide, will get access to the fields when the schools are not using them.

“I think this was a big positive for both the school system and MSI in resolving some legal issues as well as guaranteeing time and space for both the schools and our teams as well as MSI,” School Board President Michael Durso said.

The plan comes two years after MSI sued the school system, claiming school officials used a flawed and unlawful process to grant the use of fields “to elite clubs that serve only a limited fraction — the wealthiest — of the County’s youth.”

Doug Schuessler, executive director of MSI, said it was unfortunate that legal action was needed but said the agreement means thousands of players in Montgomery’s youth soccer community will get to play on better fields and have more fun because of it.

“We’re excited to get going, and we’re excited to provide the opportunity for these players to have many of their experiences on excellent-quality fields,” he said.

The legal battle that started in July 2014 came as school leaders have looked to public-private partnerships to help fund turf fields. Youth athletic organizations have made major financial commitments to be able to use the school fields during certain hours.

The legal resolution means the new school fields will be built without construction costs to taxpayers, school officials said.

The settlement ends MSI’s legal challenge of long-term use agreements the county had with the Potomac Soccer Association and the Bethesda Lacrosse Association — involving planned new field construction at Winston Churchill High School — and an agreement with the Bethesda Soccer Club for an existing field at Richard Montgomery High School.

The general outlines of the agreement say MSI will steer a total of $2.4 million toward field construction at Whitman and Einstein and will provide as much as $2.8 million toward up to two turf fields and lighting at Julius West. The agreement includes variations, in case there are difficulties with approvals at Julius West. MSI will get about 1,000 hours of access each year at each field for the next decade, and then it can seek to renew its use agreement.

The agreement clears the way for the Churchill project, which was on hold, and for the field use agreement to continue at Richard Montgomery.

If all goes as planned, Montgomery would have artificial turf fields at nine high schools, two middle schools and an elementary school. Various permits and approvals are needed, but the projects could be completed in 2017, officials said.

Durso, the school board president, noted that Montgomery — Maryland’s largest school system — has 25 high schools, leaving many without turf fields. School district plans to pursue an $11 million multi-year turf field program did not survive budget deliberations this year.

“Does it cover all of the concerns countywide? Certainly not,” Durso said. “But I think it chips away significantly at some of those issues, and we hope to continue efforts like this.”

Alan Goodwin, principal at Whitman High, said he was glad to hear of the public-private partnership behind the projects at a time when county funds are limited. “More schools need these fields to ensure that all students and community members in Montgomery County have the opportunity to participate in athletics,” he said.