There's a disclaimer at the beginning of the Boulting brothers' 1947 film Brighton Rock that assures us the town it depicts is of the past, "another Brighton of dark alleyways and festering slums...crime and violence and gang warfare...now happily no more". The film was based on Graham Greene's 1938 novel, which in turn, the author insisted, drew on a background that was already passing into social history. "The Brighton race gangs were to all intents quashed for ever as a serious menace at Lewes Assizes a little before the date of my novel," Greene wrote in Ways of Escape. And yet the film, now in a new print, stands up so well because of its prescience about the postwar period. An unlikely mix of social realism and metaphysical speculation is synthesised in something peculiarly powerful and vaguely prophetic. And although Brighton Rock seems in part to be intended as an attack on the rise of popular culture, which Greene clearly disdained, time has transformed it into a paean to a kind of melancholy Englishness.

Its central figure, the boy gangster Pinkie, is presented as being apart from this modern seediness. Evil he may be, but pure of mundane pleasures and cheap thrills. As he stalks his prey, the newspaper man Hale, in a saloon bar that evokes the spiritual desolation of the pub in The Waste Land, we hear the singing, the cackling laughter of his nemesis, Ida Arnold, a wonderfully blousy Hermione Baddeley. "Won't anybody shut that brass's mouth?" are the first words that Richard Attenborough spits out in his coruscating performance. Ida represents the worldliness that Pinkie detests.

Like Eliot, Greene had a fear and disgust as well as a fascination for the masses. He places Pinkie above his own - in the world but not of it. He makes him Other, that is to say Catholic. And although he faces damnation, there is something absolute about his fate, while Ida is condemned to the limbo of seances and ouija boards. There is sympathy for the devil (he even makes Pinkie's phone number 666) and beyond the vulgar fleshpots and amusement arcades there is Hell, an exclusive nightclub to which only Catholics are guaranteed entry.

That's all very well, but it rather betrays Greene as an over-keen adult convert to the faith. Speaking as one born into it, I have always found his desire to use Catholicism as the driving force in a novel of ideas slightly preposterous. The Church of Rome and intellectualism are simply incompatible. As Lytton Strachey observed of that other famous proselyte Dr Newman and the Vatican's distrust of him: "It was not the nature of his views - it was having views at all that was objectionable."

It would be pointless, then, to take issue with anything theological in Brighton Rock ("the appalling strangeness of the mercy of God" is the conclusion in both film and book, whatever that's supposed to mean). Instead we witness something else, something much more interesting. Whether deliberately or not, Greene uses the very perversity of Catholic imagery to convey a complex psychosexuality. And because so much is bound up in repression, in a scant articulacy, this atmosphere translates into the screen version.

A doll that Pinkie wins on a sideshow and absently pulls the hair out of "reminds me of church, Bill". On his first date with Rose, played with a wide-eyed, almost greedy masochism by Carol Marsh, he mocks her by confessing his childhood voyeurism. "I've watched it," he says. "I know love." At his wedding to Rose he tells Dallow, his lieutenant (William Hartnell, as ever the convincing heavy) that as a child he wanted to be a priest. When Dallow scoffs, Pinkie states coldly: "They keep away from all this."

Pinkie's misogyny and apparent disgust at heterosexuality suggest there might be something else going on. In the book we learn something of his initiation by the older gangster: "Kite had picked him up - he had been coughing on the Palace Pier in the bitter cold...Kite had given him a cup of hot coffee and brought him here - God knows why - perhaps because he was out and wasn't down, perhaps because a man like Kite needed a little sentiment, like a tart who keeps a Pekinese." In the film Dallow states the case more obliquely in his explanation of why the gang must kill the newspaper man: "Pinkie loved Kite. Kite trusted Hale. Now Pinkie runs this mob." But although Attenborough's boy monster glows with perversity and certain English gangsters might well have taken a shine to a bit of rough trade by the pier, even the "little sentiment" between men is left unsaid. We are spared the dreary semantics of psychology. Instead we have a mystery story, albeit a ludicrous one where the "perfect crime" is for Pinkie to damn Rose - or, better still, make her damn herself by committing the most mortal sin of suicide.

As Pinkie is unknowable, so he becomes iconic. His background is real enough - the racecourse gangs of the 1930s, the postwar spiv culture of the black market. He is archetypal of the small-time nastiness of English criminality but also predicts future manifestations of homegrown youth culture. Strangely, he prefigures American icons of juvenile delinquency (Brando, Dean and so on). But without their transatlantic glamour or essential wholesomeness he never quite achieves their virile degeneracy.

This callow-faced rebel is not just a troubled teenager - he is utterly nihilistic. His location in space and time is a dreary English saturnalia, part pleasure, part menace, a seaside town, a bank holiday. It is Whitsun weekend by the Palace Pier when Pinkie's mob kill Hale, the same feast day and the same place that in 1964 mods fought with rockers. "Sawdust Caesars," a magistrate called the mod boys in their cheap Italian suits and stingy-brim trilbys.

Pinkie is the original sawdust Caesar, just as he is the slick-haired ted with a razor blade, Alex in A Clockwork Orange, skinhead, suedehead, casual, any kind of well-dressed hooligan. I remember when Johnny Rotten first appeared, full of anaemic fury; with the shock of recognition we knew at once who this sickly youth was. It was Pinkie.

We can feel properly nostalgic for Brighton Rock now. Brighton itself has lost much of its menace and seediness and become much like the film's description: "a large jolly, friendly seaside town in Sussex". And the teenage menace seems to have disappeared. Pop culture has eaten its young or forced them through hoops in the dreadful new talent-show world. Pinkie's image, however, still hovers like the ghost at the feast, a negative image. He is, of course, the Pop Idol from Hell.

It's hard to locate a real tradition of homegrown film noir but Brighton Rock comes close to it. It certainly connects with what Peter Wollen has called the "spiv cycle" of British films such as They Made Me a Fugitive and It Always Rains on Sundays (both also made in 1947), whose wide-boy protagonists drew a certain amount of sympathy from a public now familiar with a thriving black market and weary of rationing and austerity.

What divides the novel and the film is, of course, the war. As real-life villain Frankie Fraser noted, "the war organised criminals", so that they graduated from the racetrack to bigger rackets. Greene has a keen ear for the aspirational hoodlum. Colleoni, the successful gangster, ostentatiously declares in his suite in the Cosmopolitan that his rooms were once used by Napoleon III "and Eugenie". "Who was she?" Pinkie asks. "Oh, some foreign polony," Colleoni replies. And Greene had done his homework, too. Colleoni could be based on Darby Sabini, who ran the Italian Mob in Clerkenwell and retired to Brighton in the 1940s. In early editions of the novel, though, he is clearly Jewish. This drew accusations of anti-semitism, and Greene made changes in later editions, but there were Jewish gangsters at that time. Jack Spot was the most notable; in the 1950s he gave a pitch at Epsom races to a pair of ambitious young thugs - Ronald and Reginald Kray.

Now that Cool Britannia has killed off much of English subcultural menace, or appropriated its imagery, Brighton Rock is worth another viewing simply as a reminder that gangster films are meant to be unsettling. This brings us to the matter of the ending of the film, which takes quite a different course from the novel. David Thomson recently noted in this newspaper that Greene rewrote Terrence Rattigan's happy ending, putting a scratch on the record that prevents Rose from hearing the awful message of hate from Pinkie. Greene saw it as a compromise, but a clever one: "Anybody who wanted a happy ending would feel that they had had a happy ending," he said. "Anybody who had any sense would know that the next time Rose would probably push the needle over the scratch and get the full message."

But is the film version really softer than the original? It has always struck me that it is much more cruel. Rose's horror is simply postponed. And while the book's ending merely finds her at confession with her parish priest, in the film she is with a nun in a small room or cell that looks suspiciously like one of those institutions for fallen women we Catholics used to be so fond of.

The celluloid ending is darker, too. Brighton Rock's conclusion seems evocative of the end of Heart of Darkness (Greene always acknowledged Conrad's influence on him). In both we are left with the lover of a central, yet unknowably monstrous, figure who has just died, and a sense of the legacy of evil he has left behind. For Kurtz it is "the horror, the horror", for Pinkie "the worst horror of all". In the novel Brighton Rock Rose goes home to hear the horror but in the film it remains unsaid, like the last words that Marlow dare not tell Kurtz's fiancee. We are left with something far more potent, an unspoken, unutterable horror.

· Brighton Rock will be showing at the ICA, London SW1 (020-7930 3647), from Friday. Jake Arnott's He Kills Coppers is published by Sceptre.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.