"It's like the end of our childhoods," says Hannah, 14, fiddling with her home-made wand. "We've grown up with Harry Potter – the first book came out basically when I was born." Her two friends, kitted out in Slytherin ties, nod wistfully. It's the night before the premiere of the eighth and final film in the Harry Potter franchise, Harry Potter and the Deathly Hallows: Part 2, and in London's Trafalgar Square, the boy wizard's most ardent followers have come to watch the Hogwarts Express pull away for the last time. Seven books, eight films and 14 years after I opened the first book on the night of my 11th birthday, it's all over.
Some fans insist to the point of outrage that the magic will never end. However, although the Harry Potter franchise is launching an official spin-off website, Pottermore, there will be no more book or film releases in the series which spanned the New Labour years and was, in many ways, the definitive central text for a generation now reaching adulthood in a distinctly unmagical world, where no incantation can shorten a dole queue.
Joanne Rowling's fictional universe of wizards, goblins and magical quests transfigured the imaginative landscape of those of us who were the right sort of age, between 1997 and 2011, to appreciate the cacophonous excitement that followed the emergence of every book and film in the series. I was given one of the very first copies of Harry Potter and the Philosopher's Stone, an edition that would be worth a fortune now had it not been read and reread until the covers fell off. I sat up all night to finish it, and when morning came, I woke up in tears: young wizards are chosen on their 11th birthdays, meaning that I had not been chosen, and was destined for a life of muggle drudgery.
"It feels devastating," says 14-year-old Milly. "You just wish it was real, that you were there, that you could go to Hogwarts and see Diagon Alley." The yearning in her eyes is familiar. Like the best fairy tales, the Harry Potter books invite us into a world that is a little like our own, only more exciting, purged of the grime and frustrations of our real lives. In this nostalgic, mostly imaginary Great British past – all lofty public schools, hearty puddings and blood feuds – there is a clear dividing line between good and evil, and friendship and decency are always rewarded. Like us, the young protagonists have to cope with exams, social prejudice, and adults who can be strict or stupid, but can solve those difficulties with a flick of their wands and soar away on a broomstick.
Dusk has fallen on the square, where 3,000 fans, overwhelmingly young women in their teens and early twenties, are camped out on the bare stone, snuggled in sleeping bags and under foil blankets that sparkle eerily under the floodlights. They are waiting for "Harry" – 21-year-old Daniel Radcliffe – to appear with his co-stars at the next day's event. The most eagerly anticipated seems to be Tom Felton, better known as Potter's arch-nemesis, Draco Malfoy, whose name cannot be mentioned without a chorus of knuckle-biting, wide-eyed squeals. The fans have come from all over the world; some of them have been here for more than a week. There is a feeling of cheerful defiance, like a protest camp to protect the wonder of childhood from the march of time.
There are a great many books and stories that are better written or less derivative, but Harry Potter spoke to a shared fantasy that if you were born special – and isn't every child born special? – you too could be part of a glittering secret world that ordinary people didn't know about. The cosy elitism of Rowling's boarding-school adventures was part of the fantasy. For most young readers, the house allegiances, hot buttered crumpets and jolly sporting ethos of British private education were as unattainable as an invisibility cloak.
Most fans in the square have turned up in self-assembled guesses at what a "private school" outfit looks like, with blazers and ties of all colours under an approximation of the Hogwarts school strip. In a chimeric clash of cultural signifiers, one young man with dreadlocks has accessorised a grubby green Che Guevara hoodie with a Gryffindor scarf.
Harry Potter is also a business, and like any business, it is protected by large men in uniform. In Trafalgar Square, private security guards in lurid orange high-vis jackets step through the crowd, clashing with the glowering green decorations Warner has laid on for the event. The security guards stand firm at the gates to make sure no undesirables get in, shooing around clusters of quiet young people in pyjamas and sleeping bags, as if professional heavies have been dispatched to ensure everyone gets to bed on time.
Harry Potter has become a global industry worth almost $5bn, breaking all publishing and box-office records and selling almost half a billion books, not to mention stacks of tie-in merchandise and a theme park. Politicians concerned by the commercialisation of childhood may well have been looking in the wrong place.
Harry Potter, however, was always about far more than trade-marked tat. As a light rain begins to fall, young people who were strangers a few days ago huddle together under umbrellas and makeshift canopies, sharing midnight snacks and curling with torches around chunky copies of The Deathly Hallows, like the last, best sleepover of adolescence. "It's just so friendly here," say two Belgian teenagers in matching raincoats. "When we arrived in London, we didn't know where we were supposed to go, but then we spotted some people in Gryffindor scarves, and we followed them, and now we're friends. People are brought together by Harry Potter." There is an atmosphere of innocence here that is utterly bewitching. "It's like the best parts of fandom come to life," says my friend, and we find ourselves staying far longer than we planned. Nobody wants to go to bed. Nobody wants the magic to end.
The next morning, Trafalgar Square is completely shut down, with screaming fans lining every sun-drenched road. The noise is incredible. Schoolgirls cluster as politely as possible to catch a glimpse of their favourite characters, chanting the names ecstatically when the stars appear on the enormous screens.
Many of the fans have drawn wobbly spectacles and lightning scars onto their faces as they shout in chorus, and I am reminded of Christopher Hitchens' observation that the lightning-bolt on the forehead was also the symbol of Oswald Mosley's fascists. Fanaticism, however twee, is always disturbing.
There is something clumsily Freudian in the way these young women are clutching their plastic and wooden wands, calling to mind the greatest difficulty with the Potter universe for any adolescent fan: the awkward way the books obscure sexuality. In Rowling's world, there are no threatening undead proto-stalkers desperate to penetrate the protagonist with pointed appendages; just a few shoddily-written heterosexual snogging scenes, and no sex before marriage.
Not that that ever stopped young readers embellishing the fantasy with their own imaginings. In shared internet forums, Harry Potter readers produced thousands upon thousands of "fan fiction" stories – mostly smutty prose placing the main characters in ever-more baffling and anatomically implausible acts of magical congress. Fans poured out their most febrile fantasies, sharing feverish ideas of what Harry and Draco might have got up to in the broom cupboards at Hogwarts. That fan fiction is petering out but most of the young people thronging Trafalgar Square seem familiar with the phenomenon.
"Fan fiction is fun," says Lien, 17. "It gets quite dirty, but I suppose it satisfies a need you don't quite get in the books." Lien glances across at her friend, who giggles, as if they have a naughty secret and they're not supposed to tell. "We are here to see Helena Bonham Carter," the two girls explain, holding hands. They are extremely keen that I know that they travelled hundreds of miles specifically to catch a glimpse of the actress, who plays the evil witch Bellatrix Lestrange. "We like her very, very much."
Trafalgar Square is now in total lockdown, with 10ft high barriers emblazoned with the house colours of Gryffindor, Slytherin, Ravenclaw and Hufflepuff keeping thousands of excited fans away from seeing or hearing what's going on inside. No muggles allowed. A group of disappointed schoolgirls in generic green blazers turns away from the barriers, gripping hand-drawn signs that say "Felton is Fit". One of the most common questions JK Rowling is asked by her young readers is: "Will the muggle and magical worlds ever be united?" In an interview with the BBC on World Book Day, 2004, Rowling told her fans: "The magical and muggle worlds will never be rejoined. If a muggle looks at Hogwarts, they will see nothing but a ruined castle with large signs on it saying: 'Keep out, dangerous building.'"
It is perhaps appropriate that education was the issue that finally mobilised the Harry Potter generation into political action. Many young people on the demonstrations against education cuts this winter held placards that read, "Dumbledore wouldn't Stand for This", or, more incisively, "F**k this, I'm going to Hogwarts".
Over the past six months, several groups of students and schoolchildren who attempted to camp out in Trafalgar Square for less Potter-specific reasons were all evicted by police. On the 26 March, I was here when 200 young protesters, mostly school pupils who had gathered for a picnic after the TUC demonstration, were kettled for hours in the freezing cold. Nathan Akehurst, 18, was also there. "A riot cop pointed his baton at me, and I don't know why, but I grabbed whatever was in my hand – a water bottle, I think it was – and I shouted: 'Expelliarmus!'. The policeman just laughed."
Harry Potter is not just a corporate racket, or a cheesy public-school fantasy in clunky prose. It's also about decency, and fairness, and courage. That's why young anti-cuts protesters carried placards declaring themselves members of 'Dumbledore's Army'. This particular fairy tale is coming to an end just as young people are learning that sometimes good does not automatically triumph. Sometimes the stupidest, meanest adults wind up in charge, and they can't be defeated simply by going on a quest to destroy Horcruxes, or finding an unbeatable wand.
The best fairy tales are also the cruellest, because you have to close the book and return to reality. Back at the premiere, watching young people drift home – back to exams, job applications and uncertainty – I remember the yearning I felt when I finished the final book in the Harry Potter series.
It was my last day of university, and my bags were packed for my big move to London the next day, leaving childhood behind forever. I sat on my suitcase in a friend's empty flat, and I read Harry Potter and the Deathly Hallows as I waited for my lift, the pages turning fast, too fast. As the Harry Potter generation discovers our first grey hairs, there will be new stories, and better stories – but that won't stop us longing, whenever that haunting theme music plays, for just one more page.