RALEIGH, N.C. (AP) — A rural North Carolina county could elect Black candidates to serve on its governing board for the first time in more than 20 years, because of a court settlement reached this week in a voting rights lawsuit.

A national civil rights organization sued in February on behalf of Black voters who alleged racial discrimination in how commissioners are elected in Jones County, 100 miles (161 kilometers) southeast of Raleigh.

Rather than continue costly litigation, the two sides reached an agreement in which at-large elections for the five commissioner posts will be replaced with a system in which seven commissioners are elected in specific districts. The change, approved by a federal judge, will take place for the 2018 elections.

“The parties share the goal that all future elections for the Jones County Board of Commissioners be conducted under a method of election that allows Jones County’s African American voters an equal opportunity to elect their candidates of choice,” the agreement signed Wednesday by U.S. District Judge Louise Flanagan reads.

Nearly one-third of the county’s 10,000 residents are African American, but a Black candidate hasn’t been elected to the commission since 1994 and the countywide election system is to blame, according to the initial lawsuit. Under the redistricting plan, two of the seven districts are calculated with Black voting-age populations slightly above 50 percent.

“We expect that there will be, as a regular matter, African American candidates elected to represent” some districts, said Jonathan Blackman, a New York attorney working alongside the Lawyers’ Committee for Civil Rights Under Law, which initiated the lawsuit. As part of the decree, the county will pay $10,000 in attorneys’ fees.

A lawyer for the county didn’t immediately return a phone call seeking comment. County officials initially asked that the lawsuit be dismissed, but mediation toward a settlement began in the spring.

In the current at-large system, each voter chooses up to five candidates, and the top five vote-getters win.

The Jones County Board of Commissioners is currently all-White, with four Democrats and one Republican. Democrats comprise the largest party by registration in the county, at nearly 50 percent.

In the past, black candidates have been supported by African American residents, but they’ve ended up losing as a result of racially polarized voting, according to the lawsuit, which alleged Voting Rights Act violations. Black voters petitioned the commission in 2014 to request a shift to voting by district.

“We pay taxes and most importantly, we love Jones County just like our white neighbors,” Elaine Robinson-Strayhorn, a lawsuit plaintiff and unsuccessful 2014 commissioner candidate, told reporters Thursday. “So we deserved to have our voice heard too.”

The settlement comes as North Carolina legislators this week redraw General Assembly maps after nearly 30 districts were struck down by federal judges as illegal racial gerrymanders. Critics of those 2011 House and Senate maps argued Republican legislators created excessive numbers of majority-black districts that in turn made surrounding districts more white, favoring GOP candidates.

A federal appeals court last year separately struck down a North Carolina state law requiring photo identification to vote, reducing the number of early voting days and eliminating same-day registration during early voting. Those who sued said they disproportionately harmed black voters.