In essence, many Hispanics and Republicans said, the outcome of the legislation may be less damaging to the party than the notion that Hispanics are not welcome among them.

“I think it’s bloody for the Republicans,” said Antonio Gonzalez, president of the William C. Velasquez Institute, a Latino-oriented research and policy organization with offices in San Antonio and Los Angeles. “The Democrats said pro-immigrant stuff, and even if they didn’t support it, it was because they said it wasn’t good enough. The Republicans said anti-immigrant stuff and so now they are going to get killed with this.”

It is a view that many Republicans share. Mr. McCain, who in May told Republicans that “the Hispanic vote is turning against us in very large numbers,” expressed similar thoughts privately this week, aides said.

In an interview on Friday, Mr. Martinez, who is chairman of the national Republican Party, called the bill’s defeat “a bipartisan failure.” To win favor with Hispanics in the future, “We’ve got our work cut out for us,” he said. “I consider it serious.”

Abel Maldonado, a prominent Hispanic Republican in the California State Senate, said he felt that both parties were damaged, but that “It hurts the Republican party a little bit more in terms of bringing more minorities into the party.”

Hispanics made up 8.6 percent of the nation’s eligible voters in 2006, according to the Pew Hispanic Center in Washington, up from 7.4 percent in 2000.

In some states, like New Mexico, Texas and California, Hispanics make up well over 20 percent of eligible voters, though that number is a significantly smaller share of the overall Hispanic population than other ethnic groups, the center found. In 2004, according to the research group, Hispanics made up 6 percent of all votes cast.