LIKE a veteran salsa dancer, Xi Jinping, the Chinese president, has responded to the United States’s “pivot” to Asia with his own twirl south of the Rio Grande. A month after a re-elected Barack Obama paid calls on Costa Rica and Mexico, Mr Xi followed in his footsteps, visiting San José and Mexico City from June 2nd to 6th.

He spent the previous weekend in Trinidad and Tobago, arriving in America’s mare nostrum four days after Joe Biden, America’s vice-president. As a welcome, the 280-strong Chinese entourage was greeted with the sound of “Ah Feel to Party”, a calypso classic, and China further enhanced the mood by promising $3 billion in (unspecified) soft loans to the eight Caribbean heads of government who trailed through to meet Mr Xi. Mr Biden, by contrast, got an earful of complaints that America no longer cared about the region.

Ahead of his planned meeting with Mr Obama in Southern California, Mr Xi’s choice of destinations looked to some like an intriguing “shot across the bow” to America, possibly in response to Mr Obama’s courting of countries in China’s orbit, such as Myanmar. On this trip, his first to Latin America as president, Mr Xi did not visit Brazil, China’s biggest trading partner in the region, nor ideological allies Cuba and Venezuela. Instead, he chose two free-trade partners of America, one of which, Mexico, is so tightly bound to its northern neighbour that it sells to America in eight days what it sells to China in a year.

There was more than superpower politics in play, though. Costa Rica and Mexico are not the commodity exporters that China has tended to court. Mexico, in particular, is a rival low-cost manufacturer, raising the possibility that China, with its wages increasing and its distance from the United States hurting its competitiveness, may now be looking for export platforms to target America.

Mr Xi’s singling out of Mexico for special attention was his most surprising move. Last year Mexican academics complained that the bilateral relationship had reached its lowest point since diplomatic relations restarted in 1972, hit by tiffs over Mexican H1N1 flu in 2009 and a presidential audience with the exiled Tibetan leader, the Dalai Lama, in 2011. With government-to-government ties strained, finicky trade disputes all but closed the Chinese markets to Mexican goods such as tequila and pork. China’s investment in Mexico has been minute.

However, two months ago, Mexico’s new president, Enrique Peña Nieto, met Mr Xi at a forum in China, and the two hit it off. José Antonio Meade, Mexico’s foreign minister, says that Mr Xi made an “express offer” to increase China’s imports from Mexico. Given what the Mexicans see as a ten-to-one trade imbalance in China’s favour, this was music to their ears.

There are big hurdles to overcome, though. The first is that the two countries do not see eye to eye on the size of the trade imbalance. Many Chinese exports to Mexico come indirectly, via America, so China does not count them, says Sergio Ley, a former Mexican ambassador in Beijing.

A second problem is a Mexican private sector that believes trade is unfairly stacked in China’s favour, and so keeps its eyes fixed on the American market. Third, Mexico is hitched to an American-led free-trade juggernaut, the Trans-Pacific Partnership, that has until now been anathema to China. For all the tequila that Mexico persuades China to buy, it will take more than fancy footwork by Mr Xi and Mr Peña to turn relations from rivalry to revelry.