MEXICO CITY — It was a minor gaffe, but a telling slip that spoke volumes about the tangled love-hate relationship between Mexico and its northern neighbor.

The respected newspaper Reforma, in an article Wednesday about new allegations of U.S. spying on Mexico, accidentally referred to Earl Anthony Wayne, the American ambassador to Mexico, as John Wayne.

Though individual Mexicans' opinions about the United States are complicated, many cling to the opinion that the U.S. is a brash cowboy of a country.

It is a view, at least as old as the 1846 U.S. invasion of Mexico, that has gained new traction this week after the German magazine Der Spiegel published an article alleging that the U.S. National Security Agency had hacked the email account of former President Felipe Calderon, one of the most pro-U.S. presidents in recent Mexican history.

The allegations, based on documents leaked by former NSA contractor Edward Snowden, came on the heels of previous reports, also based on Snowden leaks, that the United States had spied on President Enrique Peña Nieto when he was a candidate.

Mexico's foreign minister and interior minister each held news conferences Tuesday to complain, and a government statement declared that U.S. spying on Mexico was "unacceptable, unlawful and contrary to Mexican law and international law." But many here saw it as an expression of outrage carefully muted to ensure that Mexico didn't do too much damage to its relationship with the U.S.

American officials, meanwhile, neither confirmed nor denied the German magazine's report, but took pains to emphasize what a great friend they had in Mexico. A statement from a U.S. Embassy spokesman noted that the two countries were "strategic partners and enjoy close cooperation on many fronts."

So it goes with the continent's diplomatic odd couple, a pair of classic frenemies who can't help offending each other yet can't quite seem to quit each other either.

The response from Calderon, who left office at the end of 2012, was a case in point: "More than just personal, it's an affront to the nation's institutions," he wrote on his Twitter account.

Calderon, as is widely known in Mexico, is ensconced in Cambridge, Mass., where he is employed as a fellow at Harvard University's John F. Kennedy School of Government.

Long before the spying scandal, the Mexican left was highly critical of Calderon's pro-American leanings. During his six-year presidency, he welcomed the U.S. into an unprecedented partnership in which security agencies of the two countries regularly shared intelligence as Calderon waged war against Mexico's drug cartels. The U.S. has also kicked in hundreds of millions of dollars to help fight that war.

This week, the former president's critics roundly chided him for being surprised by what happens when one lets a fox into a henhouse. Some accused him of being a lackey. A cartoon in the left-wing paper La Jornada depicted Calderon complaining, "I energetically protest the spying by the U.S. government — I'm offended that they don't trust their employees."

Many observers criticized the Peña Nieto government for what was seen as its tepid response to the previous U.S. spying allegations in July and September. The government essentially demanded that the U.S. open an investigation.

After this week's allegations, the government ratcheted up its response incrementally. Jose Antonio Meade, the foreign minister, said Wayne would be summoned to discuss the new allegations. Interior Minister Miguel Angel Osorio Chong said an investigation would look into whether any Mexicans colluded with the U.S.

A key question is whether the revelations will do lasting damage to the U.S.-Mexico security relationship. After Peña Nieto took office in December, some U.S. officials worried that their tight security partnership with the Mexicans would fray. At the same time, there has been some indication that the new government is changing the rhetoric of how it describes the controversial drug war it inherited, while maintaining the same basic plan.

George W. Grayson, a Mexico expert at the College of William and Mary, said he didn't expect the spying allegations to change the relationship much. He considers the response from Peña Nieto's government as a sop to the Mexican left, whom Peña Nieto, a member of the centrist Institutional Revolutionary Party, or PRI, is courting as he attempts to pass a wide-ranging domestic reform agenda.

Grayson also noted that the PRI, which ruled Mexico in a quasi-authoritarian style for much of the 20th century, had a long history of spying on its fellow Mexicans.

"For the PRI to condemn eavesdropping is like a brothel owner condemning prostitution," Grayson said.

Mexican academic Sergio Aguayo said Wednesday in a radio interview that Mexico had in fact been forced to talk tougher after the leaders of France and Brazil complained much more forcefully about similar U.S. spying allegations in their countries.

"Finally the Peña Nieto government raised the argument by a few decibels — not too much, [but] they raised it a little more," said Aguayo, who added that Mexico's simultaneous "feelings of admiration and rejection" toward the U.S. were preventing it from standing up for itself more forcefully.

The assumption, of course, is that too much complaining could jeopardize U.S. security funding for Mexico. But the U.S., too, has been careful not to complain too loudly over recent events involving such a key trade and security partner. The U.S. responses were notably muted after a Mexican federal police attack last year on CIA agents and the court-ordered prison release in August of drug lord Rafael Caro Quintero, the convicted killer of a U.S. drug agent.

Calderon's predecessor, Vicente Fox, who served as president from 2000 to 2006, also weighed in on the controversy this week, saying in a radio interview that the allegations against the U.S. were not that big a deal.

"Spying has existed," he said, "since the time of Adam and Eve."

richard.fausset@latimes.com