RALEIGH, N.C. (AP) – A federal judge is dismissing lawsuits challenging a North Carolina election law that requires voters to show photo identification when casting ballots.

U.S. District Judge Thomas Schroeder’s ruling Monday leaves in place the state law that requires those voting in person to show an accepted type of photo ID, eliminates same-day registration, and ends out-of-precinct voting.

The U.S. Justice Department, the North Carolina NAACP chapter and voters had sued. They argued the law was passed to discriminate against poor and minority voters in violation of the Constitution and U.S. Voting Rights Act.

Schroeder ruled that while North Carolina had a sordid racial history, the plaintiffs didn’t show that the law hampered the ability of minority voters to exercise political power.

Governor Pat McCrory issued a statement after the ruling by  Judge Schroeder.

“This ruling further affirms that requiring a photo ID in order to vote is not only common-sense, it’s constitutional,” said Governor McCrory. “Common practices like boarding an airplane and purchasing Sudafed require photo ID and thankfully a federal court has ensured our citizens will have the same protection for their basic right to vote.”