The Mexican economy is getting a helping hand from unlikely allies: Chinese workers whose rising wages are leading more companies to build factories in Mexico.

Meco Corporation, a U.S. maker of folding chairs and barbecue grills, is shifting production from China to Mexico after wages at its Chinese operations more than doubled since 2007.

We ran the numbers and made the decision to move our equipment down to Mexico, with the decision really based on trying to give our customers more stable pricing, said Meco President Harrell Ward.

Premium leather goods maker Coach Inc (COH.N) also ran the numbers this week and decided to sharply cut production in China, citing rising labor costs.

Meco, a family-owned manufacturer from Greeneville, Tennessee, does its sums in millions rather than billions. But its plans to invest $10 million in a plant in northern Mexico is a positive sign for a country which has been in China's shadow for the last seven years in terms of U.S. import share and is also battling to control drug-related violence.

For the first time since China entered the World Trade Organization in 2001 and became an exporting superpower, Mexico posted a bigger gain in U.S. market share than its Asian rival during the first 11 months of 2010.

Mexico probably ended 2010 with just over 12 percent of the U.S. import market, its largest share ever.

Mexican factory wages are now about 14 percent higher than those in China, the Mexican finance ministry estimates. In 2002, officials calculate they were 240 percent higher, canceling out Mexico's natural advantage of proximity.

This advantage has also been highlighted by a rise in shipping fuels to two-year highs, making shipping goods across the Pacific a less attractive option.

The closing wage gap means Mexico will likely win even more U.S. market share in coming years, said Sergio Luna, an economist at Citigroup's Mexican subsidiary.

This is good news for Mexico as it limps back from a deep recession. Manufacturing accounts for a fifth of the economy, and about 80 percent of its exports go to the United States. It also shows how labor markets might be helping to correct part of the problem of the so-called global imbalances.

In 2010, Mexico's manufacturing exports soared 29.5 percent to $246 billion. A major chunk of that was Mexico's auto exports, which rose 53 percent to $65 billion, mainly going to the U.S. market.

Even so, Mexico is among many countries which complain that China has kept its yuan currency artificially weak in order to support its export industry. Economists say China's focus on exports, coupled with America's dependency on imports, has thrown the global economy out of whack and raised risks of future financial instability.

But China is starting to run short at the margin of the young workers prized by factories, fueling higher wages.

Rising food prices in China at the start of 2011 are expected to drive inflation up this year after a dip in December, which will pressure wages further.

After years of getting clobbered by Chinese competitors -- Mexico's share of the U.S. import pie fell to 10 percent in 2005 -- higher Chinese wages are now making it easier for Mexican factories to compete.

Sooner or later the flood was going to have to subside, said Salomon Pressburger, who heads Mexico's Confederation of Industrial Chambers and runs a jacket factory near Mexico City.

PAYOFF FOR U.S.

Foreign direct investment in Mexico is growing -- along with countries like Malaysia and Vietnam -- and Mexico's government estimates FDI could be up to $19 billion this year.

Setting up shop in Mexico can be good for U.S. business because Mexican factories tend to buy more U.S.-made components than Chinese ones. Overall, Mexico buys nearly twice as many U.S. exports as does China, and anything that creates more demand for U.S. goods eases global imbalances.

If a firm needs to offshore, it is in the U.S.'s strategic interest they locate to Mexico or Canada, our biggest customers, said Barry Lawrence, who studies industry and trade at Texas A&M University.

Over the last two years, Jabil Circuit (JBL.N) has hired about 7,000 workers in the Mexican city of Guadalajara, where it produces electronics including BlackBerry smartphones for Canada's Research in Motion (RIM.TO) (RIMM.O), said Cesar Castro, a Jabil manager. In labor costs, we are practically tied with China, Castro said.

Collectron, a U.S. factory service provider, recently shepherded investments into Mexico for making medical devices that a few years ago would have gone to China, said the company's president Maria Elena Rigoli.

Nonetheless, the tables have not quite turned. China remains a juggernaut with 19 percent of the U.S. market. Most of companies that left Mexico probably aren't coming back soon and the security situation is a concern for some investors.

AlixPartners ranks Mexico as the most competitive country to make several factory goods but the consultancy had one client recently cancel a plan to move into Mexico because of the security situation, said managing director Stephen Maurer.

More than 34,000 people have died since Mexican President Felipe Calderon declared war on the drug cartels four years ago, although some regions have been hit harder than others.

Meco's new factory is opening in Saltillo, a city of 725,000 which has so far not been hit badly by the drug war. Official statistics show 45 drug war deaths since late 2006, compared to 260 deaths in the similarly-sized Morelia.

Ward is dealing with the risk by not allowing employees visiting Mexico to travel by night. Indeed, he's considering buying a second factory in Saltillo that would work in tandem with assembly lines in the United States.