Spirits have been high and coffers full in commodity-rich developing nations from West Africa to East Asia recently, thanks to record-high oil prices. Countries like Nigeria, Venezuela, East Timor and, of course, the Middle Eastern oil states are seeing record inflows as prices continue to spiral upward. Net exporter Mexico is growing fat, too--oil has yielded an extra $12 billion in revenues so far this year. But far from being gleeful about the boom, officials there are fretting about the impact of high oil prices on the country.

The paradox is a result of Mexico's unique place in the global economy. Unlike many oil states, Mexico has a relatively diversified economy--only 10 percent of its exports come from oil. The problem is that the other 90 percent, including things like electronics, textiles and medical supplies, go almost wholly to the United States. And there, high oil prices are beginning to have a dampening effect on the economy. What's more, non-oil exports are facing increasing competition from China, which has siphoned off thousands of Mexican manufacturing jobs. And a sclerotic state-controlled oil sector hasn't invested enough in homegrown refineries, meaning that Mexico must buy refined petroleum from the United States, at the going prices. The result, says Alejandro Werner, a senior adviser at the Finance Ministry, is a situation in which "the Mexican economy may slow down, even as oil prices continue to go up."

How much it slows will depend on just how far the U.S. economy falls. According to Jonathan Heath, chief Mexico economist for HSBC, for every $5 increase in the price of oil, U.S. growth is cut 0.4 percent. Already there are signs that nosebleed oil prices are dampening American consumer enthusiasm. Two weeks ago Federal Reserve chairman Alan Greenspan said that high oil prices have cut into U.S. GDP growth this year, and warned of worse to come. If that happens, the border area Mexico shares with the United States, where hundreds of maquiladoras churn out goods for the U.S. market, would suffer. That's a concern; after all, it was the maquiladora sector that helped wean Mexico off its historical dependence on oil.

This poses a problem precisely because Mexico no longer relies as much on oil as other big net exporters in the region--only 35 percent of total government revenues come from Pemex, the state-owned oil company, compared with 80 percent in Venezuela. Nevertheless, that's enough money to allow politicians to stall on further economic reforms and diversification. More than 60 percent of Pemex's pretax revenues go to fill state coffers, and the take rose four percentage points this year, crippling production, exploration and refinery capacity. Even with some $16 billion in oil exports to the United States last year, Mexico had to re-import nearly a quarter of that amount in refined-petroleum products because it doesn't yet have the plants to do the job.

There's also looming concern about just how much more oil Mexico has. Cantarell, the largest oilfield in the country, is thought to be reaching maximum capacity. The deep waters of the Gulf of Mexico have proved difficult to drill even for big Western majors. The state oil sector--which banned foreign participation in oil exploration and extraction in 1938--has had even less luck. Last August Pemex officials announced a 54 billion-barrel untapped reserve in the Gulf of Mexico, only to recant a week later with the news that they had no real proof of its existence.

The situation has forced some Mexican officials to rethink their energy policies. Last week Pemex officials testified before Congress about fiscal changes that need to be implemented to avoid further drains on the company. While the government is using some of Pemex's extra cash this year to pay off external debt and develop regional infrastructure projects, it has also wisely set aside a portion in a special oil fund to be used for future investments in exploration and production. There's also growing talk among reformist politicians about opening up the state oil sector to outside investment (which even communist Cuba permits).

To ensure long-term stability, though, Mexico needs a far more fundamental shift. So far the U.S. economy hasn't endured the kind of meltdown that would spell economic chaos south of the border, which means Mexico likely won't have to worry about a Christmas budget shortfall. But as long as the economy is fixated on El Norte, the underlying problem will persist. "Mexico is diversified in what it exports, but not in where its exports go," says energy analyst Alejandra Leon. Increasingly, it will need to be both.