A richer, better organised country fared less badly than Haiti. Even so, the government struggled to respond to the massive scale of the destruction

THE mood in Chile over the past few days has swung as violently as buildings did in the early hours of February 27th. The terror of the massive 8.8-magnitude earthquakeso intense that many still cannot bear to talk about itquickly turned to relief, at least in the capital, Santiago, which escaped relatively unscathed. That was tribute to the quality of the country's building standards. Even the sheet-glass of modern office and apartment blocks was unbroken, despite the alarming swaying they suffered. But farther south, where the devastation and disorder was much more severe, anger set in.

By March 3rd the deaths of over 800 people had been confirmed, but officials said that several hundred remained missing. Worst hit were a string of towns and villages on the coast either side of Concepción, the country's second city, as well as the remote Juan Fernández islands. The earthquake triggered several giant waves that swept away thousands of houses. The victims included fishermen and farm workerssome of Chile's poorest peopleas well as campers and backpackers who had been enjoying the last week of the country's summer holidays.

The government seemed slow to react. Long accustomed to natural disasters, Chile has plenty of emergency food rations, but aid started to reach the hardest-hit regions only three days after the quake. By then looting was widespread in Concepción, a city of 600,000 people. A local official talked of a "social earthquake".

Shaking Chileans' image of themselves as a law-abiding people, the pillaging affected not only supermarkets but also department stores, with looters taking things, such as plasma televisions, that hunger or cold could not excuse. In response, President Michelle Bachelet declared the regions of Bío-Bío and Maule "catastrophe zones" and sent 10,000 troops to keep orderthe first time the army has been thus used since Chile returned to democracy in 1990. A curfew and patrols by troops seemed to curb much of the anarchy.

Officials admit that they made mistakes. The most serious was the national emergency office's early assurance that there was no risk of a tsunami (it misplaced the quake's epicentre as being on land). The government's slow response and failure to maintain order were partly caused by its reliance not on old-fashioned radios, but on the internet and mobile telephonesboth of which were knocked out by a power failure. For the first seven hours the government thus had no information about conditions south of Santiago. At first it was ambivalent about calling for international help.

Ms Bachelet has been a popular and successful president, but she is due to hand over power on March 11th, bringing to an end 20 years of rule by the centre-left Concertación. It will fall to Sebastián Piñera, a centre-right businessman who won January's presidential election, to lead the reconstruction. He will inherit an economy in which a recovery from recession has been abruptly cut short by widespread destruction to roads, ports and businesses.

Eqecat, a risk-modelling company in California, won itself publicity with an instant assessment that the earthquake could have caused $15-30 billion in damage, or up to 20% of Chile's GDP. That is a guess, since companies are still counting the cost. The forestry industry, which accounts for around 8% of exports and is centred in the worst-hit regions, may be shut down for at least a month because of damage to factories and to transport links, says Charles Kimber of Arauco, a big forestry firm. Winemakers, concentrated between Maule and Santiago, suffered too. At some vineyards, storage tanks split open.

The government is faced with restoring roads and ports, building 500,000 new homes and repairing 1m others that were damaged. It can draw on some $11 billion in a sovereign fund, most of it saved by Ms Bachelet's government from windfall revenues from copper exports. Mr Piñera has a big job on his hands.