Ever since she went missing on her way home from school last month, police and local people had searched everywhere they could think of for Shannon Matthews.

After 24 days of a police manhunt that combed the area around Dewsbury, West Yorkshire, she was found in the drawer of a divan bed in a flat less than a mile from her mother's home.

Last night, a 39-year-old man was being held on suspicion of abduction. Neighbours named him as Michael Donovan, whois thought to be a distant relative of Shannon's step-father and lived inthe flat raided in the Batley Carr area.

Shannon's mother, Karen, and step-father, Craig Meehan, were taken from their home in Dewsbury Moor to be reunited with the girl.

At a little after noon yesterday, in an anonymous-looking ground-floor council flat in the Batley Carr area of Dewsbury, the dream that Karen Matthews had tried so desperately to keep alive for 24 days suddenly came true.

Arriving at the flat accompanied by specialist search officers, detectives from West Yorkshire Police smashed down the door. Neighbours looked on as officers dragged out 39-year-old Michael Donovan. Nothing, however, could have prepared the neighbours for the next sight. As police drove the man away, another officer emerged from the house, holding tightly in his arms a small girl with mousy brown hair. "Have they found her?" a neighbour called out. The officer simply replied: "Yes it is Shannon, she is safe."

As the forensic science teams entered No 26 Lidgate Gardens, less than a mile from where Shannon was last seen, David Hughes, 46, who lives at No 12, watched in amazement. His voice cracking with emotion, he recalled the moment he saw her emerge from the flat, dressed in the clothes she had been wearing the day she went missing.

"I had heard a bit of noise and went outside to see what was going on," he said. "The next thing I saw was the door being smashed in and the police going in. A few minutes later I saw two police officers drag him out. He had handcuffs on and wasn't walking. He was moaning saying he'd done nothing wrong.

"After that little Shannon came walking out behind him. She was wearing a blue coat and trousers; it looked like what she had been wearing in the CCTV pictures. She wasn't crying or anything."

Mr Donovan, a tall, thin man with black cropped hair, described by local people as a "loner", is said to be distantly related to Shannon's stepfather, Craig Meehan. Police were apparently called to his ground-floor flat after an upstairs neighbour heard footsteps and a child's voice while he was out. Although Mr Donovan has two children of his own, both are thought to have been taken into care.

At West Moor Junior School, the last place Shannon had been seen, the headteacher, Krystyna Piatkowski, called a special assembly. Many of the children who filed into the assembly hall that afternoon must have thought they were about be told that the worst had happened. Instead, they were greeted with the news that everyone hoped for, but few dared to believe: Shannon was safe. People at the assembly said there was barely a dry eye in the house as school friends hugged each other in the knowledge that their classmate was alive.

Residents of Moorside Road, where Shannon lived with her mother and stepfather, could barely contain their delight or shock at the return of a girl they had all campaigned so vigorously to find. Neighbours celebrated with an impromptu street party. Music was blaring from a stereo system as people drank beer and wine from cans and bottles. A banner hanging from the window of one house read: "Welcome back Shannon."

Shannon's uncle Neil Hyett, 36, who lives next door to the Matthews family, said: "I was the one who phoned her dad. He couldn't believe it, like me he was nearly crying."

West Yorkshire Police's elite homicide and major inquiry team has been in charge of the search, indicating how unlikely they thought it was that they would find Shannon alive. The chances of finding an abducted child safe reduce rapidly after a day. According to one study in the US, 91 per cent are killed within 24 hours.

Davinia Darch, manager of the UK Police National Missing Persons Bureau, said it was very unusual. "With a young child you would hope to find them very early on; the first six hours are crucial," she added. "Unlike teenagers, they do not tend to go missing of their own intent, they are abducted and unless you know it's not a parental abduction for instance, sadly you would expect to find a body after a short period of time."

Yesterday's dramatic rescue resolved a mystery that had gripped the nation and shone an uncomfortable spotlight on the media and British society's double standards when reporting on the often uncomfortable circumstances of a broken home.

But for Ms Matthews, Shannon's father, Leon Rose, and the thousands of residents who had braved sub-zero temperatures night after night in their desperate search, yesterday was a day to celebrate.

Shannon was last seen in public shortly after 3.10pm on 19 February. She had just returned to West Moor Junior School from a swimming lesson at the local pool and set off for her home in Dewsbury Moor, a 10-minute walk away. The final CCTV footage, taken as she left the Dewsbury baths, showed her wearing a puffer jacket with a fur-lined hood, a blue school top and furry pink and grey Bratz boots.

Shannon never made it back home and her mother became increasingly worried. She placed a tearful 999 call at 6.48pm which was later released to reporters in the hope that whoever was holding her might be moved to tell police where she was. "I have been everywhere I can think of friends-wise, family and everything," Ms Matthews told police.

As the media descended on Dewsbury en masse, West Yorkshire Police launched what would become the largest manhunt since the Yorkshire Ripper inquiry 30 years ago. Sixty detectives and 300 uniformed officers were involved in the search for Shannon, along with half of the entire force of specialist sniffer dogs available to British police.

As the days passed by and the media coverage of Shannon's disappearance became increasingly sporadic, there was widespread criticism that her case was not garnering the coverage it deserved simply because Shannon came from a working-class home with a complicated family history.

Critics drew inevitable comparisons with the disappearance of Madeleine McCann, which received blanket coverage from the mainstream media and resulted in a reward totalling £2.6m. The reward for Shannon's safe return was a paltry £50,500, £50,000 of which was put up by The Sun newspaper.

Some believed the media to be pursuing an actively hostile agenda towards Ms Matthews, who, they remarked, was an easy target for those wishing to point the finger of blame at an unconventional family set-up. An interview on the BBC Radio 4's Today programme drew criticism for appearing to dwell on the fact that Ms Matthews – a woman who, at the time, had barely slept in three weeks and was regularly seen by friends in torrents of uncontrollable tears – had a family of seven children by five different partners.

A similar tone was in evidence elsewhere. One newspaper columnist wrote: "I wonder if our media aren't just reacting to an unspoken mood in the country, a feeling that a woman who has seven kids by five different men and who isn't living with any of them, must be a pretty dire mother and so must bear some of the responsibility for her missing daughter." Many felt the coverage highlighted an unpleasant truth: that, ever dominated by class prejudice, British society's response to a grief-stricken family missing a child is swayed according to where the victims sit in the social pecking order.

Those concerns will, however, have seemed irrelevant last night as Shannon was reunited with her mother. Ms Matthews will undoubtedly focus more on the ordeal her daughter has suffered than on the treatment she has received from certain quarters of the media.

Police are believed to have found Shannon after acting on a call from Julie France, who lives in the same street as Mr Donovan. Speaking to reporters yesterday Ms France, who has eight children, said she thought she saw Shannon on the day she disappeared but initially thought her mind was playing tricks. Only when she came across a discarded bag with a swimming towel in it while out walking her dog did she make the connection and decide to contact the police.

"As soon as I made the connection something clicked in my brain," she said. "Suddenly I realised the day I spotted [the girl] must have been Tuesday the 19th, the day she went missing."

She said police officers visited her two days ago and then started knocking on doors in the area which led them to a neighbour in the flat above where Shannon was found who then told police she had heard a child's voice in the room below.