It was a relaxed Sunday morning in summer when a black Audi estate pulled up outside the Munch Museum in an Oslo park. Within seconds, armed robbers were waving a .357 Magnum pistol at visitors and guards. Then they faltered. They had to ask to be shown the two most famous paintings in the museum. No one put up an argument. They emerged with two framed pictures, got in their car, and were gone. It was 11.20am on August 22 2004.

Oslo's police headquarters, just five minutes' drive from the museum, is a modernist block on a wooded hill above the kebab shops of a district called Greenland. Normally it would have been packed with detectives, but this was a Sunday in late August. As news reached the station, urgent calls were made to senior detectives at home. But this wasn't just a weekend ruined; it was the beginning of an inquiry that would keep them in the world spotlight for months on end. It wouldn't let up until the most famous painting of modern times was found.

It's always dangerous to describe a work of art as "visionary". But Edvard Munch's 1893 painting The Scream - Skrik in Norwegian - is a document of visionary experience. Just as the British Romantic artist and poet William Blake saw spirits and portrayed them, the late 19th-century symbolist Munch, abetted by loneliness, absinthe, magical experiments and by the spiritualist Christianity of his childhood, could slip into hallucinations.

Munch said he felt a great scream piercing the world. He described the vision several times, in written accounts published and unpublished in his lifetime. He was walking by the Oslofjord with two friends, looking at Oslo from the south-east, on a path his painting makes appear more like a bridge or a pier that rushes away from the beholder in a drastic perspective emphasised by the lines of the railings and what resemble planks. In the distance, behind the solitary screamer, are two featureless, top-hatted men. It was sunset. The sky turned "red like blood". Tired and ill, he leaned on the railing, "looking out across flaming clouds that hung like blood and a sword over the deep blue fjord and city". His friends walked on. As he stood there, trembling with anxiety, "I felt a great, infinite scream pass through nature."

Pain has robbed the screamer of features. Simplified to a yellow skull on a shrouded body curved in an S shape, thin, serpentine hands against the emaciated cheeks and covering its ears, the personification of unhappiness stretches its mouth open in a vertical oval, and screams.

This is the icon of agony armed robbers carried off in August 2004. They broke the frames off The Scream and the other stolen painting - Munch's darkly sensual Madonna - within moments of leaving the museum, afraid there might be tracking devices hidden in the gilded wood. The getaway car was found abandoned 10 minutes' drive from the museum, sprayed inside and out with thick white fire extinguisher foam to erase DNA traces and fingerprints. On the museum's CCTV recordings, grainy, ambiguous images failed to give a clear view of the armed robbers' faces.

There are still mysteries in this case, still trials and appeals pending, but what happened next is clearly established. The thieves had a hiding place in mind for the paintings, and according to the testimony of racing driver Thomas Nataas, they weren't taking no for an answer.

Nataas drives a "Batmobile" - it's painted like Batman's car, complete with bat logo. He and his car are icons among fans of drag racing - Nataas, a Norwegian, is currently one of the leading drag racers in Europe. Most fans are probably unaware that their champion was acquitted last year of a criminal role in the theft of The Scream.

The court accepted Nataas's defence that he was involved against his will. Nataas drives to race meetings in a bus, and lives in it on tour around the continent. Before the robbery, an acquaintance asked if he could "put something" on the bus. Nataas refused, but it was no use: the two stolen paintings were stored on his bus soon after the robbery. Nataas has said he acquiesced, and failed to contact police, out of fear for his life.

On September 25 2004, just over a month after the robbery, a meeting of the conspirators was arranged in the countryside outside Oslo. In most of Europe this would still be an almost summery time of year but in Scandinavia, by late September, the weather is damp and cold and misty. In the gloomy landscape, Nataas's bus was parked at a prearranged place. The two paintings were transferred to a car. Where they were taken next is still not known.

In Oslo's police headquarters, Iver Stensrud, a veteran detective, was leading the investigation by the organised crime division. They had a tip-off about the meeting in the countryside, but it was not specific; they knew something was happening, but not that it concerned The Scream. Only later did they realise they had come very close to seizing it, if only they'd known that was the moment to pounce.

The investigation preoccupied news outlets all over the world and intrigued every art crime expert. Like most Norwegians, Stensrud had visited the Munch Museum, but he hadn't quite grasped the scale of The Scream's global fame before he took on this case.

Edvard Munch was born in 1863. Norway in the 19th century was a poor and almost unknown place, just starting to rediscover a cultural heritage that goes back to the Vikings' sagas and carvings. He grew up in Christiania (as Oslo was then called) when it was more like a provincial town than a capital. Even today, it is small and quiet compared with more southerly European cities. Walk its streets in dwindling winter light and you are in the world that inspired The Scream. The centre looks much as it does in Munch's 1892 painting Evening On Karl Johann, which shows the ghostly faces of workers walking home, the parliament building behind them. You can stand on the same pavement, watching today's tired commuters progress the same route.

Munch came from a distinguished family - his uncle was a famous nationalist intellectual - but his father was an unsuccessful doctor and their meagre flat was haunted by death. First his mother died when he was small, then a favourite sister. He defied his religious father by becoming an artist, won scholarships to study in Paris and spent the 1890s in fevered movement around Europe, coming back, always, to Oslo and its fjord, a long, winding, tree-lined inlet. As soon as he had some income from his work, Munch bought a country house - really just a fisherman's shack - next to the fjord, and the fjord's distinctive light gives his art its unique personality.

Munch's great images were all created when he was a young man, from the late 1880s to the early 1900s. In 1908, years of abuse - drinking, not eating enough, isolating himself - led to a complete breakdown. After he recovered in a Danish sanatorium, he was a much milder painter.

When you look at his classic works in Oslo's National Gallery and the Munch Museum, you can follow them, not as a narrative exactly, but as a spiritual autobiography he called the Frieze of Life. The Scream stands alone in our imaginations, but when you relate it to other scenes in the Frieze of Life, its meaning becomes clearer. His painting Anxiety depicts exactly the same view of the Oslofjord, but this time an entire crowd of ghoulish creatures walk bleakly towards us: their faces have the same dehumanised, spectral futility as those of the people he painted on Karl Johann street. In other words, the face in The Scream is that of a modern city dweller cut off from the life-giving forces of nature, cut off from belief or hope or love, cut off from other people, and able to perceive the life force only as a terrifying, destructive storm. The figure in the scream covers its ears against that sound even as it opens its mouth wide to add to the world's screech.

The painting struck people as extraordinary from the moment it was first exhibited in 1893. When the Nazis came to power and banned "degenerate" modern art, Munch was one of their hate figures; this helped popularise him abroad.

None of this explains why The Scream's fame so far exceeds that of its creator. When Munch died in 1944, among the works he left to the city of Oslo were not one but two oil paintings of The Scream. The two differ slightly in palette; the National Gallery's version (which was also once stolen) is yellower, as if stained by the nicotine smoke of some fin-de-siècle cellar bar. The version stolen from the Munch Museum is brighter and more lurid in hue. Yet no one really distinguishes them, and few know there are two. At a cultural level there is only one, and it is an idea, not an object.

Munch published a lithograph of The Scream in 1895; the boldness of it translates perfectly to black and white. The Scream is not an icon by accident but because he imagined it as just that.

Iver Stensrud sits at a table in his office on which I've laid out a modern poster of The Scream. As a Norwegian, he has become very proud of Munch, he says, through realising how much this masterpiece is loved around the world. But when the investigation was dragging on, this fame made his job harder. Experts interviewed by newspapers suggested the painting had almost certainly been spirited into eastern Europe by the Russian mafia. Then a rumour reached the press that it had "definitely" been destroyed. All these notions were distractions from what he saw as a very traditional police operation - systematically "turning over every stone".

Within days of the robbery, leads from contacts in the Oslo underworld gave the crime squad several suspects' names. Norway may be a small, rich country, but the high quality of life, and high prices, produce a crime problem of their own. Drugs, like everything else, cost a lot. Importing them is highly profitable. Precisely because it is a small country, the same gangs involved in the drugs trade operate in other fields and all tend to know each other.

Stensrud says he believed from the start that the thieves of The Scream were locals who would prove "known to us". Speculations about a commissioned theft or mafia involvement just didn't ring true. "It was not very professional; they hadn't done their homework very well. There was confusion about where the painting was... This gave us something to think about."

There was one very odd feature of the crime: its timing. When the raid at the Munch Museum happened, police resources were focused on what was, for Norway, a horrific crime. In April 2004, there was an armed robbery at the Norwegian Cash Service (Nokas) offices in the western port of Stavanger. A senior police officer, Arne Sigve Klungland, was machine-gunned and died on the spot. All the country's top detectives, including Stensrud's division, were working on the murder of one of their own.

It seemed more than a coincidence. Stensrud floated the theory that perhaps the Munch Museum robbery was actually an attempt to divert police resources from their armed-robbery-and-murder hunt in Stavanger. The Scream is, after all, more famous around the world than the late Arne Sigve Klungland. The pressure to find it might distract from his death...

When one David Toska was arrested in April 2005 and charged with leading the Stavanger robbery, Stensrud told Norwegian papers he believed this would lead to the discovery of the Munch paintings - that's how convinced he already was of the link between the two crimes. By that time he already had six people in custody in the Munch case, and in spring 2006 they came to trial. Three were convicted and three - including racing driver Thomas Nataas - were acquitted. But the paintings had still not been recovered and none of the men was revealing their whereabouts.

In the hopes of concentrating their minds, two of the convicted men were ordered by a judge to pay back the estimated value of the two paintings - in reality a gross underestimate but more than enough to give anyone pause: about £62.5m. In reality, it's hard to calculate what The Scream might fetch, except to say that it would break all records for modern art.

David Toska got 19 years for leading the Stavanger armed robbery. Norwegian papers have reported that it was Toska's lawyer, Oystein Storrvik, who told police where they might find The Scream and Madonna. So it looks as if Iver Stensrud knows his Norwegian underworld, and that the most famous modern painting was indeed stolen to distract attention from a police officer's death.

From whatever source - and they are still cagey - the police did get a crucial tip-off last summer. Ingebørg Ydstie, chief curator of the Munch Museum, got the call she had been longing for in early August 2006, the second anniversary of the theft. The police, speaking to her on conditions of strict secrecy, summoned her to a meeting to advise on what precautions they needed to take, "going out there" to collect the pictures. She was taken one afternoon to police headquarters, where detectives were gathered by a parked van. "There were 20 to 30 policemen standing in a row; it was quite emotional. Then they opened the back of the van and there the paintings were. Tears filled my eyes."

The recovery of The Scream and Madonna by Stensrud and his department on August 31 last year made as many headlines around the world as did the original theft. What didn't get much publicity was the discovery, when museum technical staff looked at the paintings, that early reports of their condition had been optimistic. The paintings won't go back on view until later this year because there is damage to be repaired, and sadly, in the case of The Scream, some that cannot be repaired. This damage tells a brutal story. The Scream, painted on cardboard, "has been wet. The lower part of the left of the figure has got damp. This water or something else has come from the outside; maybe they were wrapped in something wet?" There are some tears in the Madonna - these are "reparable".

As Ydstie says, "It has not been a sophisticated crime." Looking at The Scream now, it is shockingly clear that the damage was caused by carelessness and neglect. A huge watery stain, like a watermark on a tea bag, seeps over its bottom left-hand corner, on the walkway and even on the lower part of the figure. Pigment has dissolved or been washed away.

Why would anyone let that happen? It had to be because the painting didn't interest them at all. Neither in the drag racer's bus nor wherever it went after that did anyone even bother to look at The Scream. It was wrapped in a damp blanket and forgotten about.

The Stavanger gang needed what Sicilians call an "illustrious corpse" to distract attention from the one in Stavanger. What could be more spectacular than stealing The Scream? After all, it caused a sensation when the other version of Munch's picture was stolen from Oslo's National Gallery in 1994 and recovered in a sting operation. Stealing the Munch Museum version proved an even bigger story. And that was the point.

The solution to this crime lay in the Munch Museum all along. Ydstie takes me behind the scenes, along a cool glassed corridor to the museum's research library. She shows me their collection of Scream artefacts from around the world: cartoons of George W Bush making the screamer scream, political badges featuring The Scream on behalf of various causes, T-shirts and inflatables, and a Scream boxing doll. The star exhibit is a howling, white-faced Halloween mask as featured in the Scream horror films. What the criminals stole was not even a work of art in their eyes, but simply, with its big eyes and open mouth, and hands like paws over its skull cheeks, the most famous face in Norway.