A border security buildup proposed in the Senate’s immigration legislation plays badly with the U.S.’s top trading partner. (Frederic J. Brown/AFP/Getty Images)

When Sen. John McCain (R-Ariz.) said this week that the Senate immigration bill would transform the U.S.-Mexico boundary into “the most militarized border since the fall of the Berlin Wall,” it sounded to many here like a sensible statement of criticism.

Then they realized he meant it as a selling point.

Mexicans have reacted sorely to proposals for a border security “surge” that would put 18,000 additional federal agents and hundreds of miles of new fencing between the two neighbors, measures that were included in a package of immigration legislation approved by the Senate on Thursday.

Coming less than two months after President Obama heaped praise on Mexico’s progress and its importance as a top trading partner, the Senate bill debate and the security buildup offered by the amendment, known as Corker-Hoeven, has reminded Mexicans that much of the United States views their country warily.

Mexico is the largest source of illegal drugs and unauthorized migrants entering the United States. But Mexicans have bristled at a debate that has focused heavily on building new walls along the border, rather than wider doors for legitimate trade and migration to pass through.

Of the estimated 11 million immigrants living unlawfully in the United States, at least 6 million are believed to be from Mexico.

Mexican President Enrique Peña Nieto’s administration has kept noticeably quiet on the U.S. debate, saying only that his government supports the reform effort.

However, the $46 billion in additional security measures offered by the amendment prompted Mexican officials to break their silence this week, when Foreign Minister Jose Antonio Meade told reporters here that “fences don't unite.”

“Fences are not a solution to the migration phenomenon, and they are not congruent with a safe and modern border,” Meade said. “They don’t contribute to the development of a competitive region that both countries are trying to build.”

Rep. Henry Cuellar (D-Tex.), whose district includes the busy border crossing of Laredo, said he has heard similar criticisms from Mexican business leaders dismayed by the “negative connotations” of additional barriers between two countries doing more than a billion dollars worth of trade each day.

“You tell Mexicans that we need a border ‘surge’ and everyone thinks of the surge in Iraq, as if we’re saying they’re an enemy to overcome,” Cuellar said. “I’m for strong border security, but a fence is a 14th-century solution to a 21st-century problem.”

The beefed-up border measures have been essential in winning support from Republican senators for other elements of the bill, particularly the so-called path to citizenship for those who lack legal immigration status in the United States.

But the security enhancements might not be enough to win over Republicans in the GOP-controlled House, putting the reform effort’s fate in doubt.

Jorge Castañeda, Mexico’s foreign minister during the administration of former president Vicente Fox, said the Peña Nieto government has erred in staying on the sidelines, calling the criticism of the fence “weak” and “tepid.”

“They should say, ‘This is an important issue for Mexico, and you should take our views into consideration,’­ ” said Castañeda, who is a professor at New York University.

Mexico’s passivity, and the negative views of the country expressed by many U.S. lawmakers, are symptoms of a U.S.-Mexico dynamic that has not caught up to the reality of the two countries’ massive exchange of commerce and people, he said.

“I think it’s proof that there’s still not a cultural and intellectual adaptation to the economic and social integration that has taken place over the last 20 years,” he said.