A month ago, when the United States men’s soccer team handed Mexico a 2-0 defeat in Columbus, Ohio, and put Mexico’s World Cup hopes in peril, the sports tabloid Esto took to English to scream shock and dismay on its front page: “WHAT?”On Wednesday, it could have said that again, but instead its big block letters read “Thank You.” Other newspaper headlines, and most Mexican fans, expressed the same sentiment because little else could really be said after the United States, in a twist as strange as an errant goal, kept Mexico’s World Cup hopes alive on Tuesday night by defeating Panama, 3-2. The Americans’ two dramatic late-game goals allowed Mexico, which had been facing a humiliating elimination only minutes earlier, to advance to a home-and-home playoff with New Zealand next month for a spot in next year’s tournament in Brazil.Such are the peculiarities of the point system in World Cup qualifying that Panama’s loss was Mexico’s gain, even though the Mexican team lost at Costa Rica, 2-1. But struggling Mexico will take any help it can get, and expressions of thanks poured forth through social media, the airwaves and other news media.“Thank you USA!!!! You can keep Texas and California!! Thaaaaaanks!!” Mario Delgado, a Mexican senator and former education secretary, wrote on Twitter.The American team, moments after its victory and well before the morning papers hit the streets, had already Tweeted a response: #YoureWelcomeMexico.It is fitting that the Mexicans would curse the Americans at one moment and thank them at another — a reflection of the complicated love-hate that underpins relations across the board between the neighbors. But this is soccer. It is one thing Mexico, as soccer-saturated as a nation could be, has expected to dominate.But the truth is that El Tri, as the Mexican team is called, has been in the doldrums for some time, with a number of upsets and poor results, the firing last month of yet another coach (something of a tradition at World Cup time) and a general funk that has produced a nation of doubters in the run-up to Brazil.“The arrogance of our soccer can be measured by the happiness our defeats provoke in Central America,” Juan Villoro, a novelist and soccer analyst, wrote on the front page of Reforma, a leading newspaper.The anxiety is hardly over, and may be more intense, with Mexico still facing the prospect of not qualifying for the World Cup for the first time since 1990 (when it was barred for using an over-age player in a youth tournament). It now faces the two-game playoff with New Zealand, the champion of the Oceania region.Villoro and others have scratched their heads over the paradox of Mexico’s lackluster World Cup history and its regular production of talents like Javier Hernández, known as Chicharito, a forward for Manchester United. Mexico has also done well in recent international youth tournaments, not to mention winning the gold medal at the 2012 London Olympics.“I hosted the national team for the sub-17 world championship, the gold medal Pan-Americans and the gold medal Olympians,” the former president Felipe Calderón wrote on Twitter. “What happened?”Despite competing in the past five tournaments, Mexico has never been a World Cup powerhouse. Analysts and intellectuals have stewed about this, including Jorge Castañeda, a former foreign minister and a scholar of the Mexican identity.“Mexico has never gone beyond the quarterfinals in the soccer World Cup, though it’s the only ‘third world’ country to have hosted” the event twice, in 1970 and 1986, he wrote in a recent book.Castañeda suggested Mexico tended to struggle at team sports in general.“The self-evident conclusion of the sporting conundrum is that Mexicans are highly individualistic in their athletic achievements, excelling in personal competition, but failing pathetically in associative sports,” he wrote.The name of the book, published in 2011, was “Mañana Forever.” It might be El Tri’s new slogan.Paulina Villegas contributed from Mexico City.