Justices David H. Souter, Ruth Bader Ginsburg and Stephen G. Breyer dissented. Justice Souter, in an opinion joined by Justice Ginsburg, said the Indiana law, which calls for a government-issued photo identification, like a driver’s license or passport, “threatens to impose nontrivial burdens on the voting rights of tens of thousands of the state’s citizens.”

Some Democrats have complained that those who succeeded in passing the law and fought on its behalf were citing problems that did not exist, because prosecutions for impersonating a registered voter are exceedingly rare, or non-existent. The real motivation of those behind the law was to hamper Democrats, those foes of the law have argued.

“This decision is a body blow to what America stands for  equal access to the polls,” said Senator Charles E. Schumer of New York, who leads the Democrats’ Senate election efforts. Other Democrats offered similar expressions of dismay. Ken Falk, legal director of the American Civil Liberties Union of Indiana, which brought the case, told The Associated Press that he was “extremely disappointed.”

But Brian C. Bosma, who was speaker of the Indiana House when the law was enacted and is now the House’s Republican leader, dismissed the Democrats’ complaints. “This is only a burden for those who want to vote more than once,” Mr. Bosma said in a telephone interview from Indianapolis. “It protects everyone.”

When the case was argued before the Supreme Court in January, there was considerable back-and-forth over how much of a burden the Indiana law could be in an age when an overwhelming majority of people old enough to vote also possess a driver’s license or other form of photo identification.

There was also discussion over how much voter fraud really exists, with some suggestions that the reason it has apparently never been prosecuted in Indiana is because those who commit fraud are good at it.

But, as Justice Stevens noted, there have been flagrant examples of voter fraud in American history. He cited the 1868 New York City elections, in which a local tough who worked for Tammany’s William (Boss) Tweed explained why he liked voters to have whiskers: “When you’ve voted ’em with their whiskers on, you take ’em to a barber and scrape off the chin fringe. Then you vote ’em again with the side lilacs and a mustache. Then to a barber again, off comes the sides and you vote ’em a third time with the mustache. If that ain’t enough and the box can stand a few more ballots, clean off the mustache and vote ’em plain face.”