WASHINGTON—The Supreme Court nullified a core provision of the Voting Rights Act in an ideologically divided ruling that eroded a landmark of the civil-rights era and threw the issue into the lap of a gridlocked Congress.

In a 5-4 decision, Chief Justice John Roberts said Jim-Crow era discrimination no longer justified requiring a group of mostly Southern states to seek Washington's approval before changing election practices. Joined by the court's other conservatives, he said the court had to act to uphold states' sovereignty,...