In the beginning, there were two stadiums by the River Wandle. On the west bank was Wimbledon Football Club. On the east bank was the greyhound track – home to the Derby, the most prestigious race in the sport.

Both stadiums were rundown and shabby. But both were centres of devotion for people from all over south London. Fans poured out of the stations at Earlsfield and Haydons Road, walking in great crowds to this riverbank sports hub. They drank beer, ate chips, shouted and cheered. A road connected the stadiums, via a bridge over the Wandle, and gave its name to both: Plough Lane.

Back in the 1980s, Wimbledon were known as the Crazy Gang, because of the tricks they played on each other – Deep Heat in the pants, tracksuits incinerated, shoes nailed to the floor – and the trouble they inflicted on everyone else. They were defiantly unfashionable but, in 1988, just 11 years after emerging from non-league obscurity, they tasted true glory when they met Liverpool in the FA Cup final. In the second half, goalkeeper and captain Dave Beasant (tight perm, tight shorts) saved a penalty. His team went on to win 1-0.

It was an astonishing triumph. At the time, Liverpool was every glory-hunting schoolboy’s favourite club, while the Dons, as Wimbledon fans called them, were chancers from a shabby corner of the borough of Merton. Their robust style was exemplified by midfielder Vinnie Jones, who went on to use his hard-man image as a springboard for a Hollywood career playing cockney gangsters.

The ramshackle Plough Lane stadium was a fitting venue for this band of misfits. In his 1990 book about football hooligans, Among the Thugs, Bill Buford described it in almost apocalyptic terms: “I thought I might be overcome by the odours rising out of my seat, so powerfully rotten were the stands on which it had been fixed.”

But by the time Buford was writing, football was changing, and the age of such grounds was coming to an end. Plough Lane would be no place for the post-Hillsborough world of the Premier League and Sky TV. In 1991, Wimbledon’s owner Sam Hammam found a temporary solution to the team’s stadium problem by moving the Dons to share Crystal Palace’s Selhurst Park ground, six miles to the south-east.

For the next few years, Hammam sought a new home for the club. He didn’t find one, however, so he sold the Dons and, separately, Plough Lane stadium (for eventual redevelopment into flats). That made him a tidy £36m, but left the Dons adrift. The team clearly could not share Selhurst Park in perpetuity, but kept failing to find another venue anywhere near their historic home. In 2002, Wimbledon’s new owners, in desperation, asked the Football Association for permission to move to Milton Keynes, a town that lacked a football league club and was keen to have one.

The FA rejected this unprecedented request, worried it might encourage clubs to become franchises that could move around at the whim of their owners. The owners of the Dons appealed, insisting that the club faced bankruptcy otherwise, and the FA backed down. The club gained a new name – MK Dons – and a new stadium. This relocation allowed the club to continue as a business, but wrenched it from its roots in South London. The fans, who had campaigned hard against the move, were furious. They had no intention of driving 80 miles up the M1 for “home” games.

The fight had welded the supporters into a tight group, and they refused to accept defeat. In a matter of days, they created a new club from scratch, called it AFC Wimbledon, and found a place for it in one of the lowest levels of English football. They would no longer be watching their team playing the likes of Liverpool, but at least they’d be watching something, and that was what mattered.

What happened next was magical. AFC Wimbledon won promotion six times in 13 seasons and, next month, they will join the MK Dons in League One. From a standing start, AFC are only two promotions away from regaining the Dons’ old place in the Premier League.

This spring a Hollywood producer bought the rights to the AFC tale: the fans who stood up to football’s moneymen

Sometimes football seems drunk on money, with its oligarch-owned clubs, its leveraged buyouts and its massive broadcasting deals. AFC, by contrast, is a refreshing glass of water. It is owned by its fans, run by its fans, and exists for its fans. It is what the beautiful game should be, a fairytale for football lovers. This spring a Hollywood producer bought the rights to the AFC tale: “The greatest underdog sports story you’ve never heard,” in the words of John Green, the bestselling American novelist who will write the script. The production company is the one behind the Twilight films. The studio is 20th Century Fox. The fans who stood up to football’s moneymen – coming soon to a multiplex near you.

But those fans aren’t done yet. Their club never did find a ground to play on in their home borough of Merton. (They have always played in neighbouring Kingston-upon-Thames.) But, as they look ahead to a first season in League One, AFC Wimbledon think that they have finally found a suitable home – which brings us back to the River Wandle, to AFC’s promised land, and to the land of the greyhounds.

The trouble is that the stadium they want to move into is not empty: it is the only place in London where greyhounds can still race. (The surviving tracks in Romford and Crayford may be inside the M25, but lack the London postcode that Wimbledon has.) To achieve their dream, AFC will have to evict the greyhounds, in much the way they themselves were evicted a generation ago.

Facebook Twitter Pinterest Wimbledon celebrate winning the FA Cup at Wembley in 1988. Photograph: Bob Thomas/Getty Images

Greyhounds have been bred for speed for millennia, but the sport was only standardised in the years after the first world war, initially in California, where dogs chased a motorised windsock – called, for old time’s sake, a “hare” – around an oval track. (The dogs never catch the hare. Either they do not mind, or have not yet noticed.)

Greyhound racing came to Britain in 1926, with a series of races in Manchester. It was a hit, and it spread across the country rapidly. By 1927, attendance at licensed tracks was 5.5 million; by 1929, more than 13 million; and, by 1945, the total topped 50 million. There were stadiums all over Britain, 17 in London alone. On 19 May, 1928, one of those tracks opened on a marshy bit of flood-prone wasteland east of the Wandle, just off Plough Lane.

I first went to the Plough Lane greyhound stadium in January, on a blustery and grim night when its vast potholed car park appeared to be at least half puddle. The stadium loomed ahead, dingy and unloved, its large, square chimney resembling that of a crematorium. A few coloured flags nobly failed to lift the general mood.

Once I had passed through the turnstiles, the experience became more upbeat. Greyhound racing attracts a broad mixture of people: pensioners, families, students, tourists, women on hen parties. Downstairs, they stood around chatting and drinking beer. Upstairs, they ate the kind of food that good pubs served before they went gastro, and looked out on to the track. It felt unstudied and unpretentious, a forgotten version of Britain.

Every quarter of an hour, a synthesised bugle heralded the arrival of a new group of dogs. Six greyhounds processed along the straight for the crowd’s inspection, then were fed into the traps to wait for the artificial hare. The bookies along the edge of the track took a steady stream of bets from punters down on the ground floor, the odds glowing red on their electronic display boards. The bets were made, the lights went up, the hare rounded the bend, the gates sprang open, and the dogs burst forth at dazzling, mesmerising, improbable speed.

When you see greyhounds stretch out, it’s magnificent. They are such wonderful creatures. They’re ballet dancers Diane McLean

Greyhounds move so fast, and their backs are so flexible, that their rear paws land ahead of the prints left by their front feet. The record for 480 metres around the Wimbledon track is slightly under 28 seconds, which works out at 38 miles per hour. “When you see them stretch out, it’s magnificent,” said a greyhound enthusiast named Diane McLean, her eyes still fixed on the track though the race was run. “They are such wonderful, wonderful creatures. They’re ballet dancers.”

McLean is a short, blonde, middle-aged barrister. As a professional woman with a posh voice, she was unusual among the racing crowd. “I actually came to the sport relatively recently,” she told me. A friend had invited her along to Plough Lane a few years ago and she was an immediate convert. “I’d had a particularly bad time. I’d lost my husband from cancer. It was just what I needed, something new, something with excitement, people being happy.”

Facebook Twitter Pinterest A race at Wimbledon Stadium, which is the last remaining greyhound track in London. Photograph: Christian Sinibaldi/The Guardian

Within months of discovering the sport, McLean had become spokeswoman for the campaign to stop AFC taking over the greyhound stadium. She spoke of that battle with calm fury, interrupted only by a young woman who came around before each race to ask if we were betting. McLean always waved her away but in this she was unusual too: if greyhound racing is about anything, it is about gambling.

In the 1920s, off-course betting was illegal, so punters needed either to trek out of town to horse-racing tracks if they wanted a flutter, or to break the law. Then along came the dogs, which raced on small tracks in residential areas. Suddenly betting was within reach of everyone. According to social surveys conducted shortly after the second world war, roughly 7% of British men gambled on the dogs regularly. These enthusiasts visited the tracks on average once a fortnight.

At first, the rising popularity of greyhound racing caused something of a moral panic. Bishops worried about it, parliament limited the number of nights the dogs could run, and well-meaning socialists feared that the sport encouraged the working classes to waste money. “The occasional winners … derive little profit from their winnings, which induce them to futile expenditure of a non-satisfying nature,” wrote Ferdynand Zweig for the Left Book Club in 1948. (Even racing’s supporters tended to patronise its punters. Among them was King Alfonso of Spain – overthrown in 1931 – who said: “Greyhound racing is a wonderful sport as it provides workers with congenial recreation … and brightens up their drab lives.”)

This disdain may explain why greyhound racing never won the kind of crossover media coverage that even relatively niche sports, such as rugby league and darts, achieved. Indeed, the few celebrities who have embraced the sport – including Vinnie Jones – have tended to enhance, rather than erode, its rough-hewn image. That never bothered greyhound people, though. The big stadiums (above all, White City in west London) could attract 60,000 punters for an evening’s racing, and did not need the media’s help to do so. Greyhound racing was, in the words of social historian Ross McKibbin, an outsider’s sport, “genuinely proletarian … and inconceivable without betting”.

According to Jim Cremin, a veteran greyhound journalist from the Racing Post and the closest the industry has to an official chronicler: “It’s almost like the old joke about Millwall fans: everyone hates us, we don’t care.”

Even at the peak of the Dons’ glory, in the years after the 1988 FA Cup triumph, average attendance at their stadium on Plough Lane never exceeded 8,000 or so football fans – just half of the ground’s capacity. Across the River Wandle, however, the greyhound track was a different proposition. It was built for 25,000 people and, on Derby days, those people came. Its stands were packed. The dogs ran into a wall of sound when they passed the last bend.

“My earliest memory is probably 1972 … this would have been full pretty much, there would have been people sitting everywhere round here, there was tote windows open up at the top,” Richard Rees told me, as we leaned on the rail and watched six greyhounds being paraded around before a race at the Plough Lane track. Rees is a successful trainer whose father and grandfather both trained dogs that won the Derby. He came to see his first race at Wimbledon in the early 1970s, and got hooked. “It was brilliant, fantastic. The atmosphere here on Derby nights in the 80s, even here, there was bookmakers standing all the way round.”

By then, however, the greyhound racing was already in steep decline. The first major blow to the sport’s fortunes came from a change in betting regulations. In 1961, parliament allowed betting shops to open for the first time since the 19th century. At a stroke, dog tracks lost their monopoly on urban betting. Attendance collapsed, taking the sport’s revenue with it.

In 1960, annual attendance was 16 million. By 1993, it was four million. By 2006, it had fallen to three million. By 2013, it was two million. “It’s hard to explain,” said Rees, “but look: 1950s, there was no internet, there was no telly, there were no betting shops. You had to go the pictures, or the dogs, or the pub. That’s the way it was.”

Rees and I were looking across at the bright lights of the grandstand, but the stadium around us was shuttered and dark. Attendances at Wimbledon are rarely a tenth of what they were in the sport’s prime, and still falling. The terraces that once heaved with humanity lour darkly above the floodlit track. All but one of the sets of turnstiles beneath the stands were boarded up, the bars were shuttered, piles of stackable chairs were thickly furred with dust. There were only three bookies at the trackside, huddled together, calculating their odds, educating novices about the precise meaning of “each way” and taking bets a fiver at a time.

Facebook Twitter Pinterest Richard Rees, a successful greyhound trainer at the Wimbledon track. Photograph: Graeme Robertson/The Guardian

Parliament has long denied greyhound racing the favours it grants to other sports. When betting shops were legalised, parliament imposed a levy on their profits, in order to support horse racing and cushion the blow caused by punters betting away from the tracks. But MPs arranged no equivalent levy for the dogs until the 1980s – and by then much of the damage had already been done.

In fact, greyhound racing is not officially classified as a sport at all. This means that, should the owners decide to close a stadium, they are not obliged to find new facilities for the dogs, as they would for other activities. As a result, once the cashflow starts to dwindle, track owners can look to realise the value of their assets in other ways: above all, by building houses. In 1960, there were 64 licensed tracks in the UK. Now there are 25.

Rees listed the London tracks that have vanished: White City, Wembley, West Ham, Clapton, Hackney, Harringay, Wandsworth, Catford, Charlton, Dagenham, Hendon, New Cross, Park Royal, others that he couldn’t remember. When the track at Walthamstow shut in 2008, Wimbledon was left as the only greyhound stadium with a London postcode.

“It’s the challenge of getting the best out of the dogs, that’s the thing,” said Rees, when I asked him why he persists with the sport. “It’s not the money. There is no money.”

The fortunes of Wimbledon’s two sports have flipped. Where once the football club could only dream of the popularity of the greyhounds, now AFC are attracting fans in numbers that the dogs cannot hope to match.

On 10 July 2002, more than 4,000 people came to watch AFC’s first match in the Combined Counties League, the ninth rung of the great ladder that is English football. Despite playing in leagues that normally commanded attendances in the low three figures, in 2003 AFC took over the lease at the Kingsmeadow stadium in Kingston-upon-Thames, which can hold almost 5,000 people. And those thousands of fans kept coming, giving AFC a huge financial advantage over its rivals. AFC progressed quickly through the Combined Counties League, then the Isthmian League, into the Conference, and finally into the elite Football League.

AFC had a stadium and a place in the League, but that was not enough. Ever since 1992, the fans felt as if they had been in exile, away from their spiritual home in the London borough of Merton. Even fans too young to remember Plough Lane yearn for the rickety, stinking old stadium that they lost a generation ago. That homesickness rings out in a song on the terraces: “Show me the way to Plough Lane, I’m tired and I want to go home. I had a football ground 20 years ago, and I want one of my own.”

AFC’s desire to return to Plough Lane did not go unnoticed among local politicians. As the club soared up through the divisions, the fairytale of its story, and the strength of the fans’ desire to return to the banks of the Wandle, began to attract attention. “In 2009, when we won the Conference South, there was a reception for us at Merton Civic Centre, and we just sensed a change in the air,” said Erik Samuelson, a tall and sardonic ex-accountant, who has guided the club since its foundation. “It went from, ‘Yeah, of course, bring us your ideas and we’ll talk to you,’ to ‘What do we need to do to get you back to Wimbledon?’ That was, I think, quite a watershed.”

I chatted to Samuelson back in March, in the last few minutes before a game against York City, which AFC went on to win 2-1. Presumably, he has told the AFC story hundreds of times, yet he showed no weariness about going through it all over again. It is, after all, an astonishing tale, and one that the club has used to attract local councillors, who are always keen to be photographed in the team’s yellow and blue scarf. “I want floodlights,” Samuelson told me with a smile, as he imagined AFC’s new home. “So when you’re half a mile from the ground you can do that slight increase in your walk that you do when you see the floodlights. Do you know what I mean? The football walk.”

Facebook Twitter Pinterest AFC Wimbledon fans watch their team in 2002, the year of its formation. Photograph: Frank Baron/The Guardian

Despite the declines in both revenue and attendance, greyhound racing limped on, but then it received another heavy blow from an entirely unexpected direction. Elderly greyhound trainers – most greyhound trainers these days are elderly – love to talk about the tricks of the trade. But trainers never told anyone about the dirtiest trick of all, which was what happened to the dogs once they passed out of sight.

On 16 July 2006, that silence was finally broken, on the front page of the Sunday Times: “Revealed: the man who killed 10,000 dogs”. According to the paper, a builders’ merchant in Seaham, County Durham charged £10 to kill dogs that were too slow to race. The article’s accompanying photographs showed two dogs being led into a shed, then their bodies being carted out in a wheelbarrow. The dogs had been slightly lame, and their owner decided that they would never amount to much.

The maelstrom of bad publicity – greyhound people refer to the incident now simply as “Seaham” – brought attention like never before. The unavoidable impression was that this was a sport that celebrated dogs while they were in their prime, but killed them when they were not. This was not the sharp practice of lovable rascals – it was barbarity.

Parliament commissioned two reports, and in 2010 new regulations radically changed the way the sport was run. By far the most important consequence was the realisation that it was no longer acceptable to kill those dogs who had either not made the grade or come to the end of their racing lives. Some 10,000 dogs retire every year, and another 2,000 British-bred puppies are not considered fast enough to race. Before Seaham, perhaps 5,000 of those unwanted dogs would have been killed annually. Today, the situation appears to be improving. A substantial number are found homes. From a dog-welfare perspective, this is better. From the perspective of the racing industry’s balance sheet, it is worse. Already suffering from sharply declining revenues, greyhound racing now found itself being squeezed by the rising costs of looking after its retired dogs. The sport has yet to find a way out of the pincer.

Much of the income of the Greyhound Board of Great Britain (GBGB) – the body that regulates, controls and publicises greyhound racing – comes from the 1980s levy imposed on bookies. The levy is only voluntary, however, and many companies simply do not bother to pay it. The industry makes some £230m profit from dogs every year but, in 2014-2015, gave only £6.9m back.

Animal welfare is now the GBGB’s largest area of expenditure at £2.9 million, but maintaining it has required cutting back on everything else. That means there are fewer adverts to bring in new punters, fewer checks on the safety of the sport, fewer rewards for its competitors.

In 2005, Risk Capital Partners joined forces with the property developer Galliard Homes to buy a number of dog stadiums throughout Britain, including the one on Plough Lane. The companies have been unsentimental in realising the financial value of these tracks, selling a stadium in Portsmouth for housing, and seeking planning permission to build houses on tracks at Hall Green in Birmingham and in Oxford.

In 2013, they brought in accountants to look into the Wimbledon track, who noted that the number of tickets sold each year had dropped 58% between 2000 and 2012, to fewer than 117,000. “The ongoing deficits … together with historical losses and a severe decline in attendance in prior periods, casts significant doubts over the stadium’s long-term viability,” the report concluded. In layman’s terms: the track was doomed.

Facebook Twitter Pinterest The number of tickets sold each year at Wimbledon Greyhound Stadium dropped 58% between 2000 and 2012, to fewer than 117,000. Photograph: Christian Sinibaldi/The Guardian

As AFC’s rise continued, local Labour and Conservative politicians pledged to bring the club home, to provide a new stadium in Merton. And there was really only one plausible place where that stadium could be: on the site of the greyhound track. Not long after the civic reception, when Erik Samuelson was so delighted by the enthusiasm for the club, the council designated Plough Lane for “sporting intensification”. This meant that if the site’s owners wanted the council’s permission for any redevelopment of their loss-making stadium, the proposal would have to involve sport. Technically, that sport could have been anything, but council leaders made their preference very clear. When AFC won promotion again in 2011, Stephen Alambritis, the leader of Merton’s Labour council, said: “I look forward to continuing to work with them as we do all we can to facilitate their search for a ground in Merton – their rightful home.” (Alambritis failed to respond to repeated requests for comment for this article.)

The investors who owned the track got the hint and, in 2012, suggested that a redevelopment plan for the greyhound track could include a stadium for AFC. The developers duly applied for planning permission. The greyhound fans mobilised against the stadium’s owners, the effort spearheaded by Diane McLean. She organised demonstrations, and won media support: not least from the Sun newspaper.

But try as she might, McLean could not muster anything like the support enjoyed by AFC, with its glorious legend, its slick lobbying operation and its small army of fans. McLean tried to explain to the council that the greyhound track had been there for the best part of nine decades, that neither the fans nor the dogs had anywhere else to go, and that their interests should be taken into account as well. But it was a dispiriting experience.

“We were on a no-hoper with Merton council right from the start. The very first day we went to see Stephen Alambritis,” said McLean. “We walked into his office, and it was all AFC and the old Wimbledon Dons.” McLean shared none of the local politicians’ enthusiasm for the fan-owned club. “What a lovely community-minded team,” she said, with extreme sarcasm. “I’m absolutely speechless, when people think it’s their right to come and kick out something that’s been here for 88 years, and it’s just dismissed … How can you say you’ve got diversity if you get rid of the last greyhound stadium with a London postcode?”

In December 2015, AFC’s overworked fairy godmother sprinkled her magic dust on Merton Council’s planning committee, and councillors voted unanimously to approve the application for a new stadium (and 600 flats). Football’s most romantic story had its happy ending, and the council decreed that joy be unconfined. When the Conservative councillor whose ward contains the new development raised mild concerns about its impact on traffic, parking and more, Alambritis criticised her sharply. “I’m really disappointed in her comments ... We were all supposed to be for the club coming back to the borough,” he said.

It wasn’t only local politicians that gave AFC their backing. Siobhain McDonagh, a Labour MP whose south London constituency is close to the stadium but does not include it, wrote to the council to support AFC’s planning application. Stephen Hammond, the local (Conservative) MP, initially expressed concerns about the (Labour) council’s haste in trying to get the plans approved. As soon as permission was granted, however, he tweeted his delight.

The battle for Plough Lane was over. AFC had won.

Facebook Twitter Pinterest AFC Wimbledon win their sixth promotion in 13 seasons to get into League One, in May. Photograph: Jordan Mansfield/Getty Images

Then, with everyone ready to shoo the greyhounds out of the stadium, the dogs suddenly got a reprieve. It came from the unlikeliest of sources: Boris Johnson, the old Etonian mayor of London – a man not associated with working-class sports or with spurning opportunities to win votes.

On 22 March, Johnson decided that City Hall should review Merton council’s decision to wave through AFC’s plans. This put the whole redevelopment on hold. His precise reasoning was something of a mystery, especially because little more than a month later he was wondering aloud whether he had made a mistake. But, whatever the explanation for his actions, the stadium’s lease has now been extended. Greyhounds will race in Wimbledon at least until Christmas, rather than be packed up this summer.

The uncertainty is still not over. Some trainers, including Rees, have already found homes for their dogs at other tracks. It will now be down to London’s new mayor, Sadiq Khan, to have the final say over what happens to this little stretch of south London – whether AFC gets to return to its promised land, or whether greyhound racing is allowed a future in the capital.

I asked Erik Samuelson if he felt uncomfortable about the fact that AFC, in teaming up with a property development company and taking over the stadium, would effectively be doing to the greyhounds what Sam Hammam had done to Wimbledon fans. “We’ve got a really good case,” he insisted, “have a look at it, and I’m not going to get drawn any further into that.”

Samuelson is originally from Sunderland, and still speaks with a trace of the north-east. Still, he has followed Wimbledon since 1987 – the year his Londoner sons started supporting the Dons – so can hardly be accused of being a newcomer. His salary as chief executive is a nominal guinea a year, and he basically runs the club for the love of the game. “If only I could have played,” he mused, as he watched the footballers warm up. “I’d give up all of this just to have played at a decent level.”

McLean told me she hoped Sadiq Khan might demand more affordable housing from Galliard’s development than the 10% it is currently planning. A higher proportion of affordable housing would dent the scheme’s profits, which could render the whole AFC stadium plan unaffordable, and open up a way for greyhound racing to retain its London postcode.

“If this closes, it puts a huge question mark over the sport as a whole,” McLean said. “Football, rugby, other sports, cricket, you name it, everyone has a place in London. Why shouldn’t we? It’s a bit of a David and Goliath story, but that one worked out OK. So maybe the underdogs – excuse the pun – but maybe the underdogs can pull something out of the hat.”

Main image: Christian Sinibaldi

• Follow the Long Read on Twitter at @gdnlongread, or sign up to the long read weekly email here.