For more than a century, the Palace Hotel in Madrid has served as a refuge and an institution. Grand and central, it was transformed into a makeshift hospital for left-wing militias during the 1936-39 civil war and became a hub of intrigue during the Second World War. It hosted wild parties during the Movida madrileña, the countercultural movement after the death of the dictator Francisco Franco in 1975.

Amid the chaos and confusion that struck the Iberian peninsula during the blackout last week, the hotel reprised its old role as a dependable sanctuary. Among those who took shelter in its luxurious corridors was your correspondent, whom a receptionist graciously allowed to use its power and phone coverage to report the day’s events.

The power cut struck at 12.33pm. Generators kicked in. Such was the smoothness of the hotel’s service that its wealthy clientele were buffered, in some cases almost totally oblivious, to the crisis outside. The lowest prices for a room rapidly shot above €600 a night as demand to lodge at the oasis rose.

The Westin Palace Hotel in Madrid, Spain.

Monday’s outage, one of the worst ever in Europe, lasted past nightfall, affecting tens of millions of people in mainland Spain and Portugal. It disrupted businesses, hospitals, transit systems, cellular networks and other critical infrastructure. At least five people died in incidents related to it.

By evening, however, the Palace Hotel’s bar, once the haunt of Picasso and Lorca, was packed with guests, mainly Americans. There was a Titanic atmosphere. The crowd quaffed “Hemingway” cocktails and gorged on burgers that only lacked an accompaniment of fries, a waiter apologetically explained, because the ovens were not turned on to ration fuel for the generators.

I told ministers blackouts were coming — here’s the plan they ignored

An elderly British gentleman remarked: “It’s ghastly. These people even wear their baseball caps at breakfast.”

The gran apagon (the great power cut), as it is now popularly known, was for many an occasion for disportment. Café terraces were full of workers sipping beer in the sun. Crowds of dog-owners gathered in parks to listen to strumming guitarists.

Kate Winslet and Leonardo DiCaprio in Titanic.

Unlike the 1997 film starring Kate Winslet and Leonardo DiCaprio, in Spain the disaster came before the merrymaking

ALAMY

Radio sets and batteries were soon sold out as people tuned in to try to find out what had happened. A friend’s four-year-old grandson, who had never seen a radio, exclaimed: “A TV with no images!”

People read books or played chess. On railway tracks in the middle of nowhere, stranded passengers practised viral dance moves as they waited to be rescued.

Sign in a store window that reads "Nao temos radio" (We don't have a radio) during a power outage.

A store in Lisbon warned would-be customers that it did not have a single radio left

ADRI SALIDO/GETTY IMAGES

Across the border in Portugal, similar scenes of chaos — and adaptation — played out. Laura Jones, a British resident in the capital, Lisbon, said: “At night we played board games by candlelight outside. Definitely a positive getting everyone away from screens.”

There were acts of kindness. A village in Andalusia opened a building to shelter and feed another group of stranded train passengers. As traffic lights failed and queues of cars congested roads, taxi drivers turned off their meters. Long lines formed for free ice cream that store owners in Madrid decided to give away.

People wrapped in blankets wait at a train station after a widespread power outage.

Some passengers spent the night at Atocha station in the Spanish capital

EPA/JUAN CARLOS HIDALGO

Drug smugglers and bullfighters also enjoyed themselves. The Maestranza bullring in Seville staged a fight for novice toreros, which El Pais condemned as a “blatant act of irresponsibility in extraordinary circumstances”. Speed boats ferrying narcotics up the Guadalquivir river near Seville are understood to have proliferated, taking advantage of power cuts to police radars. Drivers who thought that traffic monitoring systems were also out of action were wrong, the authorities said, and those who exceeded speed limits can expect a fine.

The failure of the governments of Spain and Portugal to explain the blackout has prompted critics to make unfavourable comparisons with Latin American countries. Brazilians hit back with a social media meme, which the Portuguese absolutely hate, calling their country Guiana Brasileira, as if it were a quaint and backward colony of the South Americans’ empire.

In Madrid, not all establishments lived up to the Palace Hotel’s mark. In a column in El Debate, a conservative online newspaper, the aristocrat Ramón Pérez-Maura registered his displeasure with the Nuevo Club, the private preserve of dukes and the ruling caste. “The staff very kindly told us that it was impossible to serve us, not even with a few cold plates,” he wrote.

As I left the Palace Hotel at night for my candlelit home, I recalled the civil war description that Martha Gellhorn, the American writer, left of the establishment’s bare floors piled with bandages, the “sleazy cotton blackout curtains” and the scarcity of food. I was not alone in thinking that things could have been worse.