
We're in a huge crowd of around 30,000 people in Badalona's Rambla. It's dark, and on the beach on the other side of the railway line, which here runs beside the sea, a huge papier maché figure is going up in such roaring flames that the fire service is having to play hoses on it to stop the blaze blowing out of control. Just then, the rain that has held off so generously all evening now begins to fall. This is Badalona's annual devil-burning ceremony - La Cremada del Dimoni.
No-one quite knows the origin of what is now a deep-rooted tradition in the city. When its modern version was first established, in 1940, as a distraction from the privations of the post-Spanish Civil War period, local historians found an 18th-century account of fishermen burning a figure (probably a ship's figurehead) on the beach to drive away evil spirits. So the custom began of building a large figure to represent the devil and then setting light to it on the night of 10 May every year, the eve of the day of Saint Anastasius, known in these parts as Sant Anastasi, the patron of Badalona.
Nowadays the festival falls within a month of celebrations throughout the city known as the May Festival (Festes de Maig). There are concerts and fun-fairs and outdoor meals, as well as performances by traditional Catalan "giants", known as "gegants", and "castellers" - teams of people who construct human "castles" seven, eight and nine storeys high.

The centrepiece, though, is always the burning of the devil, who this year it has to be said didn't really look devilish at all. An annual competition is held to find the best design and the winner often follows a topical theme. This time, the main subject of discussion in the news when the contest was held was the dreadful flooding in and around Valencia that claimed hundreds of lives last autumn. And so Badalona's devil was covered in mud, dressed in an overall and seemingly doing his best to help. That was never going to save him, though. All devils come to the same fiery end after just a week or so standing proudly on the beach, surrounded by a growing pile of smaller demons made by schoolchildren.

There is a whole procedure and plenty of entertainment to be gone through first, though. First, the main organisations representing popular culture pass through the crowds in the Rambla, whose number is now capped at 30,000. There are the Miquelets, dressed in 18th-century militia uniforms, firing their noisy blunderbuses; the Diables, surrounded by whizzing fireworks in a performance which in many other countries would be a health and safety nightmare; the Badalona giants, making their stately way through the people; and the Castellers, in the form of a moving pillar of people.
Then the Diables are back for their traditional pitched battle against Sant Anastasi himself. This looks like an unequal struggle as there are plenty of them, including four-horned Llúcifer himself, armed not only with even more of those loud fireworks of theirs, but also with satirical verses. They use these to attack everything from threats to the Catalan language to the city management of the mayor himself. But the saint, as always, will not be cowed, and he runs out an unlikely victor. Then the great ceremonial eagle comes in - a huge figure that manages to perform a dainty dance, guided by helpers all wearing eagle's heads.

This year the festivities have been given a modern facelift, and a show featuring hundreds of meticulously controlled drones lights up the sky. We've been promised this will be all about Badalona, but initially it's hard to fathom what's going on. Then we begin to see the point: there's the Roman name of the city, Baetulo; the Venus of Badalona, the most famous archaeological find in the city; there's its most famous product, the aniseed liqueur AnÃs del Mono; and basketball, Badalona's favourite sport ever since it first arrived in the city early in the 20th century. It all goes down well, although some of the best entertainment comes from the caustic asides uttered by the teenage lads standing to our left.
When the drones end, the fireworks begin - not just a few hopeful rockets, but a magnificent display with flashes of colour making patterns in the sky again and again above the palm trees. When I first came to Catalonia 25 years ago, I had never seen anything like the firework displays and I couldn't get over them being free to watch. "But how would you charge for fireworks?" people kept saying to me. And the more I thought about it the more illogical and bizarre it seems to have to buy a ticket for something happening in the air for all to see.

I have to confess, though, to not being a fan of the more modern tradition of coupling fireworks with music, in what is known here as a Pyromusical. I know the idea of combining them with tunes goes back hundreds of years, to composers like Handel and before, but I object for two reasons: firstly, the music and visuals never properly match; and secondly, the music itself is generally awful. This year's selections from our Mayor's CD collection were no exception. Boney M? No! Please!
And, as the fireworks banged and flashed to a crescendo and then died away, and the flames began to creep over the body of the Badalona devil himself, the music was no better - surely the very worst cover of Simon and Garfunkel's Sound of Silence ever recorded. The teenagers beside us were lapping it up, though, dancing and jumping. Meanwhile, the flames climbed into the night sky, fanned by a sea breeze, and jets of water were brought into play to keep them out of the way of the passing trains, which hooted in eery greeting.
Badalona may be a fragmented city, with the relatively well-off centre having little to do with the poor periphery, and the divisions between haves and haven-nots, between Catalan- and Spanish-speakers, and between long-term residents and new immigrants fanned like the devilish flames by the unpleasantly right-wing city government, but tonight everyone's here. Or if they couldn't make it into the Rambla, they're watching from further away on the beach or on local TV, sharing a simple but unshakable annual ritual. It's nights like this that build communities we realise, as the teenagers head off through the rain for concerts going on into the small hours and we turn for home.