It's a wintry day in the East End of Glasgow. A freezing drizzle is falling on the grim parades of decaying shops and scruffy bookmakers. In the shadow of the mighty Celtic Park, a dozen or more football players are having a kickabout on a municipal soccer pitch.

Seen in some lights, this could be a depressing image. Yet this apparently desultory game actually represents a triumph because all the players on the pitch were once homeless. And football has helped them overcome their desolate fate.

David Duke is 27. During a lull in the game, he jogs over to the touchline. "I come from Govan, from a pretty ordinary background. My dad was very keen on football and I had the same passion as I grew up."

He turns to shout encouragement at the players, as someone nearly whacks in a goal. He looks fit, happy, and self confident, which makes the rest of his story all the more shocking. His face clouds as he speaks: "A few years ago my life just fell apart. First, my dad died. Then I lost my job and my girlfriend. So I started on these drinking binges. I ended up blacking out, losing weekends - you know what I mean? And it spiralled from there."

The saying is that no-one is more than two missed pay cheques from the street - that it only takes a few consistent knockbacks to destroy someone's social status. And David is living proof of that. Without a girlfriend, grieving for his father, minus his salary, he ended up skipping rent. Then the inevitable happened - he got booted out of his home.

David's particular problem was his pride. "I was isolated, too embarrassed to go to relations for help. For a while I kipped on floors and sofas, but in the end I was properly homeless. It was horrible. I would walk all night around Glasgow until my legs turned to jelly. I slept in bus stations. It was freezing."

He points down the road. "Just along there is the hostel I first went to when I'd had enough of bus stations. You know what they call the hostel? 'Nightmare on Bell Street'. It was terrible. Smelly and dirty. There were junkies outside, dealing smack. I just put my head down every night, and tried to ignore the screams."

After a few weeks of this hellish existence, David landed a place in a residential scheme for homeless people under 25. He had his own kitchen, and bathroom - a proper bedsit.

"It was a real improvement on Bell Street. I was putting my life back together. And then one day I saw an advertisement in the 'Big Issue' for homeless football, which made me think." He smiles at the memory. "I remembered how I used to play for Celtic Boys. I mean, I was good! Then one of the staff at the scheme told me that, if I made it through the trials, I could travel to Sweden for a tournament: The Homeless World Cup. That was the clincher. But if you want to know more about the cup, you should talk to that guy over there."

David Duke points at a smiling, slightly crumpled, grey-haired man. This is Mel Young, the organiser of The Homeless World Cup. As the match heads towards a tense conclusion, Mel explains his extraordinary scheme.

"I'm 51. I started life in community publishing in the 70s. I worked on the 'Wester Hailes Sentinel', a newspaper for a pretty deprived housing estate in Edinburgh. By the 1990s I was very angry about the appalling numbers of homeless people in Edinburgh and Glasgow. Then one day in '93 I saw people selling the 'Big Issue' in London. I signed an agreement, and by Christmas that year we were selling 140,000 copies of Scotland's very own 'Big Issue'."

It was through this involvement that the Homeless World Cup originated. In 2001, Young went to South Africa, to attend a World Conference of Street Papers. Editors of Big Issues, and similar papers, came from across the globe to swap ideas and experiences. One evening, Young found himself sharing a few beers with Harald Schmied, who runs the Graz street paper. Discussing ways to unite homeless people from across the world, they hit on football - the sport without frontiers. And so the idea of a Homeless World Cup was born.

Some might have dismissed the notion as one of those beery notions that looks a bit mad in the grey light of dawn. But Young is made of sterner stuff. He went to see Schmied the very next day, and said: "Are we going to do this or not?"

Two years later, the first Homeless World Cup was held in Graz. Teams from 18 countries took part. The event was a slam-dunk success. Every year since, it has grown. Sweden saw 26 teams competing. In 2005, 27 teams went to Edinburgh. 2007's competition took place in Copenhagen.

Young does not feel his job is done: "We've got 10,000 homeless people playing football. That's great. But it should be 100,000, or 200,000. I am incredibly ambitious for the Homeless World Cup. We're going to build a global network where people come and change their lives."

This is a pretty striking claim. Does the Homeless World Cup really 'change lives'? Studies indicate it might. Post event research, done six months after the Edinburgh tournament, showed that, of 217 homeless competitors, 38% were in regular employment, 40% had improved their housing situation, and only 18% were still selling street papers. And a whopping 94% declared that they had 'a new motivation for life.'

Amongst the people changed by the Homeless World Cup is Mel Young himself. "I always have been political," he says. "One of the things I hate is unfairness in the world. But it's only when I did this project that I really felt engaged. Starting the Homeless World Cup changed me personally - I've met fantastic people, mainly from the homeless community."

As Mel implies, in the end it is all about them - the homeless - the guys on this pitch here in drenched and drizzly Glasgow. The players walking to their changing rooms, smiling and slapping backs, buzzing and chatting after their game.

Mel gazes at the players, with a thoughtful expression: "I think it changes everybody. The homeless players change because they find inspiration, self-respect and self-esteem from the crowd's applause. The public also change as they usually have a stereotypical view of what a homeless person is like, that he lives on the street, is dangerous. Then they seem them playing a game, and showing commitment. Attitudes evolve."

As if to confirm Young's thesis, David Duke wanders over, and tells the rest of his tale: "After I started playing football again, everything else fell into place. I began to enjoy life. I went to the gym, went swimming. I was eating right, looking after myself. I cut down on the booze. And, yes, in the end I made it to Sweden. I've recently been to Namibia, too, for another homeless tournament."

David is keen to get changed. But before he goes, he says. "The best trip of all, though, was to Copenhagen this year: the fifth Homeless World Cup. Because we won in the final, 9-3 against Poland - and I was the coach!" He laughs. "Imagine that? Scotland winning a World Cup? Fantastic!"

As he turns and jogs away to the locker room, the drizzle is still falling. But somehow it seems a little less irritating, and the cold just a little more bearable.