HOT and high in the Sierra Madre, the city of Saltillo is a long way from Wall Street. Stuffed goats keep an eye on customers in the high-street vaquera, or cowboy outfitter, where workers from the local car factories blow their pesos on snakeskin boots and $100 Stetsons. Pinstriped suits and silk ties are outnumbered by checked shirts and silver belt-buckles; pickups are prized over Porsches.

The financial crisis of 2008 began on the trading floors of Manhattan, but the biggest tremors were felt in the desert south of the Rio Grande. Mexico suffered the steepest recession of any country in the Americas, bar a couple of Caribbean tiddlers. Its economy shrank by 6.1% in 2009 (see chart 1). Between the third quarter of 2008 and the second quarter of 2009, 700,000 jobs were lost, 260,000 of them in manufacturing. The slump was deepest in the prosperous north: worst hit was the border state of Coahuila. Saltillo, its capital, had grown rich exporting to America. The state's output fell by 12.3% in 2009 as orders dried up.

The recession turned a reasonable decade for Mexico's economy into a dreary one. In the ten years to 2010, income per person grew by 0.6% a year, one of the lowest rates in the world. In the early 2000s Mexico boasted Latin America's biggest economy, measured at market exchange rates, but it was soon overtaken by Brazil, whose GDP is now twice as big and still pulling away, boosted by the soaring real. Soon Brazil will take the lead in oil production, which Mexico has allowed to dwindle. As Brazilians construct stadiums for the 2014 World Cup and the 2016 Olympics, Mexicans, who last year celebrated the bicentenary of their independence from Spain, are building monuments to their past (and finishing them late). Mexico's muscles Yet Mexico's economy is packed with potential. Thanks to the North American Free-Trade Agreement (NAFTA) and a string of bilateral deals, it trades more than Argentina and Brazil combined, and more per person than China. Last year it did $400 billion of business with the United States, more than any country bar Canada and China. The investment rate, at more than a fifth of GDP, is well ahead of Brazil's. Income per person slipped below Brazil's in 2009, but only because of the real's surge and the peso's weakness. After accounting for purchasing power, Mexicans are still better off than Brazilians. Though expatriates whinge about bureaucracy, the World Bank ranks Mexico the easiest place in Latin America to do business and the 35th-easiest in the world, ahead of Italy and Spain. In Brazil (placed 127th) companies spend 2,600 hours a year filing taxes, six times more than in Mexico. Registering a business takes nine days in Mexico and 26 in Argentina. The working hours of supposedly siesta-loving Mexicans are among the longest in the world. And although Mexico's schools are the worst in (mainly rich) OECD countries, they are the least bad in Latin America apart from Chile's.

These strengths have helped Mexico to rebound smartly from its calamitous slump. Last year the economy grew by 5.4%, recovering much of the ground lost in 2009. Exports to the United States, having fallen by a fifth, have reached a record high. In the desert there are signs of life: Saltillo's high street, where four out of ten shops closed during the recession, is busy again. CIFUNSA, a foundry that turns out some 400,000 tonnes of cast iron a year for customers such as Ford and Volkswagen, shed 40% of its staff in 2009, but has rehired most of them and is producing more than it did before the slump.

However, the jobs market has yet to return to its pre-recession state. Nationally, the official unemployment rate is 5.4%, having peaked at 6.4% in 2009. Javier Lozano, Mexico's labour secretary, believes that the pre-recession mark of 4.1% will not be matched within the term of this government or the next (ie, before 2018). What's more, the new jobs are not as good as those that were lost. Average pay last year was 5% lower than in 2008. Because of this, and rising food prices, more Mexicans have slipped into poverty: last year 46.2% of them were below the official poverty line (earning less than 2,114 pesos, or $167, per month), up from 44.5% in 2008.

Just as recession came from the gringos, recovery depends partly on them. Many analysts who once predicted economic growth of 5% this year cut their forecasts to under 4% after a downward revision of American GDP in July. Exports account for nearly a third of Mexico's trillion-dollar GDP, and most go to the United States. Remittances provide $190 per person per year (down from $240 in 2007). Now America faces several years of lacklustre growth, which poses a dilemma for Mexico.

Some look at the recent explosive growth of Brazil and wonder if it is time to follow its example and look to new markets. In 2009 only 3% of Mexico's exports went to Brazil, Russia, India or China, whereas Brazil sent 16% of its exports to its fellow BRICs. Industrialised countries receive less than half of Brazil's exports but 90% of Mexico's. The Inter-American Development Bank, the biggest lender in the region, describes a “two speed” Latin America, in which economies, such as Mexico, which do most of their trade with developed countries, lag behind those, such as Brazil, that have forged links with emerging markets.

South or north?

Mexico has already diversified its exports. America's share of them has fallen from 89% in 2000 to perhaps 78% this year and will fall further, according to Miguel Messmacher, head of economic planning at Mexico's finance ministry. Sales to Latin America and Asia are growing twice as fast as those to America. The automotive industry, Mexico's biggest exporter, is ahead of the trend: though exports to America continue to rise, they now make up only 65% of the total. Eduardo Solís, head of the industry's national association, says he would like to get the figure down to 50% by focusing on Latin America and Europe.

Others say Mexico's economic future will always be to the north. “We can't just become a commodity exporter and start sending soy beans to China,” says Jorge Castañeda, a former foreign secretary. History, geography and natural resources have wedded Mexico to its wealthy neighbour: “It's not something we chose,” he says. If the American economy is growing slowly, Mexico will just have to get a bigger chunk of it.

That task has been made harder by China. Since China joined the World Trade Organisation in 2001 its share of American imports has grown fast and is now the biggest. The shares of Canada and especially Japan have fallen. Mexico's share, which almost doubled in the seven years after NAFTA came into effect, slipped after 2001. But it is edging up again (see chart 2). China's low wages, which lured factories away from Mexico, are rising rapidly. In 2003 Mexican pay was three times Chinese rates but now it is only 20% higher, Mr Messmacher says. The rising yuan and the cheap peso accentuate this trend. Proximity to America, Mexico's trump card, has been made more valuable by the high oil price. The resolution in July of a long dispute has allowed Mexican lorries to make deliveries in America, which the Mexican government reckons will reduce firms' shipping costs by 15%. The rise of China may also help Mexico too, by forcing American companies to compete more keenly. Detroit carmakers cannot export cars to South Korea, but a Mexican factory using American parts can, notes Luis de la Calle, a former trade minister. Luring foreign investors has been made trickier by a spike in violence. Since 2007, a crackdown on organised crime has caused Mexico's drug-trafficking “cartels”, as they are known (though they are in fact rather competitive), to splinter and fight. Last year the murder rate was 17 per 100,000 people, a little lower than Brazil's, but more than two-thirds up on 2007. Ernesto Cordero, the finance minister, has estimated that the violence knocks about a percentage point off Mexico's annual growth rate.

The fighting is highly concentrated: last year 70% of mafia-related killings took place in 3% of the country's municipalities. In Yucatán state, where tourists scramble around Mayan ruins, the murder rate is no higher than in Belgium. Last July was the busiest ever for Mexico's foreign-tourist trade, but there are signs that the drip of bloody stories is starting to hurt bookings. In the first five months of this year, arrivals were 3.6% lower than last. Acapulco, which caters mainly to domestic tourists, has virtually emptied thanks to frequent shootings in the heart of the hotel zone.

Many of the roughest areas are in the north, where foreign investment is concentrated. In Ciudad Juárez, a centre of maquila factories that assemble products for export, the murder rate has climbed to one of the highest in the world, as the Sinaloa and Juárez cartels battle for control of the border crossing, little restrained (and often aided) by the local police. In Tamaulipas, a border state where violence surged last year, the unemployment rate has risen to 7.5%, the highest in the country. The head of a Mexican multinational with operations there found recently that his local manager had been siphoning company money to the cartels. Many rich businessmen have moved their families to America; the governor of one border state is rumoured to have done the same (his office denies it).

Investors have largely held their nerve. Foreign direct investment, which reached $30 billion in 2007 but fell to half that in 2009, is expected to recover to $20 billion this year. Businessmen play down the violence: Mr Solís admits that some car transporters have been robbed on highways, but says that this year has been better than last. This month Honda became the latest carmaker to announce plans to expand in Mexico, in spite of the insecurity.

Still, insecurity adds costs and delays. The road from Saltillo to Monterrey, the nearest big airport, has become dicey, so more people rely on Saltillo's own tiny airport, where a single airline offers flights to Mexico City for upwards of $400. Conferences, concerts and sporting fixtures have been cancelled in Monterrey. In Coahuila on August 20th a football match was abandoned after shots were fired outside the stadium. Some foreign companies are even nervous about sending executives to Mexico City, although it has a lower murder rate than many American cities.

From Uncle Sam to Uncle Slim

Despite Mexico's difficulties, one of its citizens is the richest person in the world. Carlos Slim, the son of a Lebanese immigrant, has made a fortune estimated by Forbes at $74 billion. The magazine reckons that last year his net worth rose by $20.5 billion.

Nearly two-thirds of Mr Slim's wealth is thought to lie in América Móvil, the biggest or second-biggest mobile-phone operator everywhere in Latin America except Chile (where it is third). In Mexico Mr Slim's grip is particularly strong, with 70% of the cellular market and 80% of landlines. In half the country's 400 local areas, only his company has the infrastructure to put through calls to landlines. Not surprisingly, after accounting for purchasing power home landlines in Mexico cost 45% more than the OECD average and business lines 63% more (see chart 3). Mobiles are better value, particularly for those who do not make many calls. But basic broadband access costs nearly ten times more (per megabit per second of advertised speed) than in the rest of the OECD. Telecoms is not the only monopolised sector. A study by the OECD and Mexico's Federal Competition Commission (CFC) found that 31% of Mexican household spending went on products supplied in monopolistic or highly oligopolistic markets. The poorest tenth suffered most, 38% of their expenditure going on such things. The cost of these captive markets is ruinous. Until recently, for example, firms selling generic medicines were required by law to operate a plant in Mexico. This, along with a system that allows doctors to prescribe medicines by brand rather than by generic compound, means that the market is dominated by expensive brands. Generics account for less than 17% of the drugs market, against 66.5% in America. Medicine is a third pricier than in Britain.

Time for some self-service The labyrinth of torpitude Transport is expensive too. The handful of budget airlines that arrived in the past decade have struggled to get take-off and landing slots at Mexico City's airport, which are dished out by a committee dominated by incumbents. The CFC found that flights to and from Mexico City were between 40% and 80% dearer than those to less strangled airports. Intercity bus routes are dominated by four firms that have divided up the country. Fares are 10% higher than they ought to be, the CFC estimates. Banking is similarly uncompetitive. Two banks control almost half the market for deposit accounts and two-thirds of the credit- and debit-card markets. The lack of choice means that 95% of account-holders have never switched banks. Top of the list of Saltillo businesses' complaints is the scarcity and cost of credit. Some of these pinch points are being addressed. The collapse last year of Mexicana, North America's oldest airline, has presented an opportunity to auction landing slots to nimbler competitors. Drugs should get cheaper thanks to an auction system devised by the CFC for Mexico's social-security institute. In April a new competition law introduced penalties of up to ten years in jail for collusion, and empowered the CFC to make surprise inspections. The same month it fined Mr Slim's mobile-phone operator a record $1 billion for abusing its market dominance.

Banking has been opened to entrants such as Walmart, which has already shaken up Mexican retailing. Commercial credit is expanding: it stands at 19% of GDP, nearly double the ratio in 2003. Lending is still less than half of what it was before the banking crisis of 1994, suggesting plenty of room for growth—certainly more than in Brazil, where credit already equals about half of GDP.

Forcing competition on cosy industries is still not easy. When the government decided in 2009 to shut down Luz y Fuerza, a state-run electricity company that was costing the taxpayer $3 billion a year, it required 1,000 police in riot gear to occupy the firm's offices. Since Luz y Fuerza shut, the wait for new connections in Mexico City has fallen from ten months to four. But its ex-employees still bring parts of the capital to a halt with protests. Labour-reform efforts, to ease hiring and firing and allow six-month trial contracts, have met opposition in congress. Even with the new competition law, few people fancy the authorities' chances against Mr Slim's lawyers.

The answer is to open the economy and let foreign competition force Mexican firms to adapt, believes Mr de la Calle. “If you have free trade, you don't need structural reforms because the companies have to compete,” he says. He cites the pork industry, which used to be blighted with hog cholera. Farmers resisted pressure to eradicate it, preferring to sell low volumes at high prices. When tariffs were dropped, cheap pork from America forced Mexican farmers to clean up their act. Cholera was eliminated, output rose and prices fell.

Other industries are ripe for similar treatment. Oil is a prime candidate. Pemex, a state monopoly, handles everything from exploration to petrol pumps. Its profits contribute a third of government revenue, allowing Mexico to maintain a generous and feebly enforced tax regime. But decades of underinvestment have hurt production, which fell from 3.4m barrels a day in 2004 to 2.6m. Brazil, which has allowed foreign investment in its oilfields, is producing around 2m barrels a day and expects to be pumping 6m by 2020.

Pemex's output has stabilised in the past year, and this month it awarded its first performance-based contracts, a precursor to getting oil majors to explore the deep waters of the Gulf of Mexico. But efforts to make the company more efficient have been vetoed by the oil workers' union. Refineries are poorly run; petrol stations forbid self-service.

The Mexican Institute for Competitiveness, a think-tank, estimates that the GDP growth rate could be raised by 2.5 percentage points if the oil industry were opened up and labour and competition laws reformed. Reeling from an American-made recession, however, Mexico is hardly in the mood for a more open economy. With a presidential election next year, it would be easier to keep puttering along in the shadow of Brazil, an economy which in some ways Mexico outclasses. Mexico's rebound from slump and its resilience to lawlessness show its underlying strength. If it could only bust the monopolistic dams that have parched its economy, its desert might one day start to bloom.