NEW ORLEANS (AP) — The system for electing state judges in a coastal Louisiana court district discriminates against black voters, a federal judge has ruled.

U.S. District Judge James Brady in Baton Rouge ruled Thursday in a 2014 lawsuit over voting practices in Terrebonne Parish, southwest of New Orleans.

Brady's ruling noted testimony from Terrebonne citizens about racial discrimination in the parish. And it included a recounting of the case of former Judge Timothy Ellender, a white judge re-elected in 2008 even after he was suspended for six months by the state Supreme Court in 2004 for attending a Halloween party in a prison garb and blackface.

Black voters and the NAACP Legal Defense Fund said the practice of electing five judges in parish-wide "at large" elections dilutes the African-American vote.

Brady agreed, and said there was evidence of discriminatory intent in the Legislature's refusal to carve out a majority black judicial district within the parish, which encompasses the state's 32nd Judicial District Court.

Brady acknowledged that after the suit was filed, a black candidate was elected, without opposition by a white candidate, to a judgeship in Terrebonne. But he went on to outline the history of legislative efforts to create a black district within Terrebonne, saying the effort was rejected at least six times between 1997 and 2011.

"Taken as a whole, this timeline shows discriminatory intent," Brady said. "Local white officials, including the judges on the 32nd JDC, originally wanted an additional judgeship, but when black advocates requested that the new judgeship be elected from a sub-district, this request was withdrawn."

The NAACP Legal Defense Fund praised Thursday's ruling in a news release.

The office of Louisiana's Attorney General Jeff Landry, a Republican, criticized the ruling Friday, but didn't say whether it would appeal.

"How can a legislatively-drawn district, that resulted in the first African American judge being elected at large in Terrebonne Parish, be struck down as 'discriminatory' or enacted with discriminatory intent?" the office's statement said.

A spokesman for Gov. John Bel Edwards, a Democrat, said in an emailed statement that the ruling was under review and would be discussed with Landry's office.