February, Elland Road: Leeds United versus Wolverhampton Wanderers. Last against second-last, a six-pointer and then some. For the home side the mathematics of defeat may not be decisive but the effect on players, club and fans, not to mention creditors owed about £100 million, will almost certainly be terminal.

The omens are bad. Leeds have lost six in a row and Wolves are showing signs of a revival. The morning's Guardian includes a doomy feature about life after Leeds United and the afternoon's Yorkshire Evening Post fills its back page with the message: 'If United fail to beat Wolves tonight will the last person out of Elland Road please turn off the lights?'

For the vultures in the press box the script for this cold, wet Tuesday night is written already: the club is about to tip into relegation, administration and possibly oblivion.

Thirty minutes in and that is just how it looks. Leeds have scrambled a goal through Alan Smith only for Wolves to cancel it out. The home defence is a mess, with goalkeeper Paul Robinson missing crosses and central defender Steve Caldwell, just in on loan, wobbling under pressure. It's only a matter of time.

Then something changes. Seth Johnson starts winning tackles; James Milner, on the wing, makes Denis Irwin look his age; Smith is reaching the high balls; Mark Viduka's little passes find their men. Sensing the shift the crowd turns the volume up, chanting with arms aloft: 'We are Leeds! We are Leeds! We are Leeds!' Just before half-time, Dominic Matteo scores and, after the hour, Milner makes it 3-1.

'Want another,' says a fan beside me greedily, and he has his wish. In the final minute Viduka wins the ball on the left, slips past a couple of defenders and thumps it between keeper and upright.

On the bus back into town afterwards fans smile and shake their heads in disbelief. They have defied the doomsayers and bought the club some precious time; there's a long way to go yet but perhaps the worst will not happen.

It's not supposed to be this way. Clubs go down or get into money trouble every year, but not a big, ambitious, city club such as Leeds. And it's not just size, it's attitude: Leeds United don't care for popularity but they demand to be respected and feared. Elland Road, with its towering east stand, resembles a concrete warning to the weak, and even on this miserable night a near-capacity 37,000 have turned out to yell: 'We are Leeds!'

Yet here they are, relieved to beat Wolves, scrambling desperately for points at the bottom of the table, so close to ruin. What went wrong?

Amid the recriminations and panic engulfing Leeds over the past 18 months much of the real story of how a great club was brought so low has been forgotten, muddled or ignored, but by talking to people were close to the key decisions and linking their testimony to the hard facts of performance on the pitch and on the balance sheet it is possible now to piece together the making of a Premiership calamity. This is the story.

Summer 1999, Elland Road: another world. The season of the Manchester United treble was just over; Leeds had finished fourth and Peter Ridsdale had a smile on his face. Everything about his club smelled of potential.

Ridsdale himself was fairly new in charge, having just consolidated his position as executive chairman. His manager, David O'Leary, was also new: promoted in October, after the departure of George Graham to Spurs, he had exceeded all expectations by producing the best league performance in years. And the team was new, flush with exciting young players who had thrilled the fans and won admirers across the country.

The world of football, too, was brimming with promise. The game was fashionable, attendances were rising, stadiums were being renovated or replaced and television companies were paying ever-larger sums for rights.

A lifelong fan - he queued in a sleeping bag to see Leeds in the 1965 Cup Final - Ridsdale could sense one of those tides which, taken at the flood, lead on to fortune.

The Leeds board of directors agreed and, in retrospect, it's easy to see why, because almost everything on the club's balance sheet was healthy. Gate receipts were up 20 per cent in a year, television income up 40 per cent and merchandising earnings up 13 per cent. There was even - unusually for a football club - a modest operating profit.

Fast-growing companies need bold thinking, and Leeds had a plan. 'There was a belief,' Ridsdale says now, 'that with the right acquisitions we stood a genuine chance of challenging towards the top of the Premiership and certainly a chance of get ting in the Champions' League more often than not. So what we had to do was to see how we could add to the squad in a way that would take us forward.'

Acquisitions. That was the strategy. So they bought players. First came Eirik Bakke at £1.75m, then Danny Mills at £4m, then Michael Duberry at £4.5m and finally Michael Bridges at £5m. Bold indeed. The club's turnover in 1998-99 - everything that came into the club over the whole year, before any bills were paid - was £37m, and here they were spending more than 40 per cent of that on players in a single summer. This was only possible thanks to a form of credit that was completely new to sport.

Football clubs have long had difficulty borrowing. In the words of one former club finance chief: 'If you want to spend money then traditionally you have to have either a wealthy benefactor or a very nice bank manager.'

Ridsdale's Leeds didn't have a wealthy benefactor nor did they want one (such people like to say how their money is spent); and while the club bank, HSBC, was obliging enough, as always with banks there were limits.

That summer, before the spree, the club had been running a bank debt of around £11m, which was high by recent standards but acceptable to both parties. When it came to buying players HSBC was ready to offer an overdraft facility on top of that but it was strictly short term; Leeds had only a few months at best to pay it off. So the club had to find some other source of finance.

The problem was that football clubs can seldom offer lenders much in the way of security. Their principal concrete assets, the stadiums, are single-use and the ground they stand on tends to carry planning restrictions, so even if your club hasn't mortgaged its stadium already, a new mortgage probably wouldn't raise much. In 1999, financiers were beginning to see this as perverse. Here was a booming entertainment business turning over hundreds of millions a year and its ability to expand was being cramped by old-fashioned credit policies. There had to be a way to break out, and it was Ray Ranson who found it.

Ranson is not one to seek publicity or grant interviews, though he is known to many football fans as one of those Manchester City defenders wrong-footed by Tottenham's Ricky Villa on the way to his famous Cup Final goal in 1981. That is no measure, however, of his talents.

Even while he still played, he ran his own insurance business. It wasn't a humdrum house-contents outfit but one on the fringes of high finance. Once out of the game he sold up, joined the London money firm of Benfield Greig and set about applying his insurance expertise to sport.

'He's a very intelligent, able and charming man and he's comfortable in both worlds, the City and football,' says a former associate. 'Football people find it easy to get on with him and he understands their problems, while in the finance world, well, they're often fans and they're impressed to meet a real footballer. It opens doors.'

In the early summer of 1999 a door opened at Leeds United and Ridsdale listened with interest as Ranson described the funding idea he had. Business was not done straight away, but at the end of July, with the ink still wet on Leeds's purchase of Michael Duberry, Ridsdale rang Ranson urgently to ask for help.

In the interval, Leeds had tried a different finance option but that hadn't worked, so now, having heard on the grapevine that Ranson had successfully put together a deal for Chelsea, the Yorkshire club recruited him to cut down its overdraft. He did it like this.

Where Leeds had bought a player for, say £5 million, Ranson would find a financial institution that would advance the club exactly that sum. In return Leeds would have to pay back this money, with interest, over the course of the player's contract - typically four years.

Though known for shorthand purposes as a 'sale-and-leaseback' arrangement, it is in most respects a conventional short-term loan, just as if you or I were borrowing £10,000 to buy a car. In the same way that, if we fail to make payments, the bank will take away the car, so if the club doesn't keep up payments the lender can make it sell the player and hand over the proceeds.

Because lenders were wary of football clubs, however, they required extra security. For one, these loans were not tied exclusively to the player: if for some reason the sale didn't cover the debt - say the player's market value had declined - the bank could claim the difference from the club. And then came the part that was the Ray Ranson speciality: the whole deal was insured with a German-based insurance company, Gerling, so that in the very worst case, if the club went bankrupt, the insurer would cover the lender's loss.

The benefit of this arrangement for the lender was that it transferred the main risk element - default by the club - to those professionals of risk, insurers. From the club's point of view the deal spread the cost of buying a player over the whole period of his contract and took the sum in question off the overdraft account, just as the bank manager demanded.

There were drawbacks. The loans were short-term and the interest rate was higher than the bank was charging, which meant that the quarterly payments were substantial (as they are with domestic car loans) and the extra insurance was expensive and had to be paid upfront.

In the late summer and autumn of 1999 Ranson successfully arranged separate finance packages of this kind to cover the purchases of Bakke, Mills, Duberry and Bridges.

The events of that season seemed gloriously to vindicate the acquisition policy: Leeds reached the semi-final of the Uefa Cup and finished third in the Premiership, clinching a place in the qualifying round of the Champions' League. The summer signings had lifted the side to a new level and Bridges, in particular, was a huge success, scoring 19 goals in 34 appearances.

The books were looking good, too. Turnover had jumped from £37m to £57m (including a 56 per cent rise in television revenue and a 33 per cent rise in gate receipts) and once again there was a small operating profit. So promising was the out look that BSkyB had taken a stake in the company.

What next? In the eyes of Ridsdale and his board the prospect of Champions' League football radically altered the terms of trade. That year's Uefa Cup run had been worth £6.9m and they had played in every round but the final. So lucrative was the Champions' League that Leeds could count on earning considerably more even if they went out in the first group stage. If they reached the second stage the very least they were likely to make was £15m. A Champions' League run, in other words, would rake in cash.

To improve the chances of such a run, and of qualifying again the following year, the board chose the same strategy that had paid off before: they strengthened the squad. O'Leary asked for three additional top-class players, one each in defence, midfield and attack. The board gave him exactly that, buying Dominic Matteo for £4.25m, Olivier Dacourt for £7.2m and Mark Viduka for £6m - a total outlay of £17.45m.

As before, Ranson was called in and he put together one of his packages to cover the Dacourt deal. Such deals take time, however, and a couple of months later he was still working on a Viduka package when Leeds United decided to take a historic step.

In the interval the newly strengthened Leeds side had successfully negotiated the qualifying phase of the Champions' League and then, after a disastrous start, surprised everyone by forcing their way through the first group stage to reach the second round. Six lucrative matches were in prospect, home and away against Real Madrid, Lazio and Anderlecht. The Leeds board decided this was the moment to strengthen the squad again: they bought Rio Ferdinand for a then British record price of £18m.

It was a huge commitment by a club still grappling with the consequences of the earlier purchases, and behind the scenes some fast footwork was required as Ranson urgently completed packages to cover Viduka and Matteo. That took some of the pressure off the Leeds overdraft account, as did the instalment arrangements on the Ferdinand purchase, but it was now clear that the club had hit a limit.

Bank debt was already historically high and the club was making hefty quarterly payments through Ranson's Guernsey-based company, Registered European Football Finance (REFF), on seven players whose total announced cost was almost £30m. To top this, the balance of the Ferdinand bill was due in a few months.

As a first step to cut down on debt costs the club approached Ranson with a proposal. The original terms of the deals had involved paying off the whole of each player's cost in the period of his contract, but Leeds now wanted to do something different. The club suggested instead that it should pay off only half the original cost by stages over the contract period, and come up with the remaining 50 per cent as a 'bullet payment' or lump sum at the end. Since the book value of the players was rising in an almost dizzying fashion there seemed to be no reason for either lender or club to worry about security. The deal was done. At least one part of the debt problem had been eased, though there would be those lump sums to pay in due course.

In this period it helped a great deal that the team not only survived the second phase of the Champions' League, recording some sensational victories, but that they won a quarter-final against Deportivo la Coruña. An honourable defeat against Valencia in the semi-final capped what was a sensational run, worth in the region of £20m to the club.

All the time, however, Leeds were busily seeking a way to restructure their debt, and this time it was not Ranson who came up with the answer for them but the very different figure of Stephen Schechter.

Ranson was born with football in his veins, but Schechter was a man who, when told in 1999 that Newcastle United might put some business his way, replied: 'Where's Newcastle?'

A Wall Street operator who was already in his fifties when he moved to London, Schechter is a prodigious talker, a showman and a financial wizard with a gift for innovation. He was working for the merchant bank Schroders when he took that call about Newcastle and, in September 1999, in a matter of months he was able to raise for that club the fabulous sum of £55m.

It was a coup which tore up the old financial straitjacket restraining football clubs, and it is little wonder that his phone was soon ringing off the hook with calls from all over Europe. Several other English clubs, including Southampton and Ipswich Town, employed him to raise cash for them.

Early in 2001 (by which time Schechter worked for another bank, Lazard's) he had a tip-off that Leeds wanted something similar. 'It was the fastest deal I've ever done,' he says. 'I'd never been to Leeds either, but I took the train and saw them. They said they wanted to refinance their bank debt and get in the Champions' League again, and they asked me to find them £50m. I put together a book and the demand [from potential lenders] was huge.'

The 'book' was Schechter's analysis of the club and in particular of that part of its activities on which the whole clever arrangement hung - its ticket sales. Just as Ranson found a way around the old problem of protecting loans, in his case by passing the risk to insurers, so Schechter had spotted an ingenious possibility. Clubs like Newcastle and Leeds may experience ups and downs, they may even dip out of the Premiership for short periods, but they have one asset that is as solid as their stadiums: the loyalty of their fans.

Leeds is the biggest city in England with only one professional club and the fans are unusually dedicated. Even at their lowest footballing ebb Leeds United can probably count on 20,000 to 25,000 people clicking through the turnstiles every time the senior team is at work.

It was this security that Schechter offered to lenders in London and New York. The arrangement worked as follows. The loan would be over 25 years and the once-a-year repayments were guaranteed through a special 'locked box' account. Every summer, when Leeds put season tickets and corporate hospitality boxes up for sale, all the revenue would be paid into the locked box, so that a substantial sum had built up by 1 September. On that date the lenders would withdraw the payments due to them from the locked box and only then was the club allowed access to the residue.

Offered to financial institutions in the early autumn of 2001, the Leeds 'securitisation' loan, as these packages are known, was a resounding success. 'The lenders wanted to go up to £75m but we closed on £60m,' recalls Schechter. 'We didn't want to offend these institutions who wanted more paper.' The lenders were M&G of London and two American institutions, MetLife and Teachers.

It was the biggest loan ever raised by an English football club.

The Premiership season by then under way would prove pivotal for Leeds United, and there is a strong argument that by the time it was over in May 2002, or at least by September of that year, the club was already doomed to disaster. Had subsequent events unfolded differently the scale of that catastrophe might have been altered or it might have been postponed, but it is doubtful if anything could have prevented it.

It is worth remembering, too - and no one disputes this - that the men in charge at Elland Road went into that season with their eyes open.

The board met every month. Peter Ridsdale, then 49, was in the chair. He had come to football after an impressive career in retailing at Top Man. He had two executive colleagues: finance director Stephen Harrison, 40, who had previously held the same position at the spectacles firm Dollond and Aitchison, and operations director David Spencer, 50, who joined Leeds in 1994 after running a catering company.

With them sat two men still described by Ridsdale as 'among the top non-executive directors in the country': the high-flying Asda boss Allan Leighton, 48, who was later to move to Royal Mail, and Richard North, 51, then finance boss of the old Bass brewing firm and now chief executive of Intercontinental Hotels.

It was a harmonious group, although naturally there were occasional differences. Ridsdale and Leighton were particularly close - they usually sat together at matches - and Stephen Schechter for one found them an impressive partnership. 'That pair could sell ice to Eskimos,' he says. 'They exuded confidence and success.'

Every time the five directors gathered in the boardroom, located in a suite of offices above a former petrol station across the road from Elland Road, they had before them a dossier describing the current state of the business. This included, among other things, summaries of every player's contract, giving wages, bonuses and term remaining, and also a rolling 18-month projection of the club's cashflow position.

So how did the world look to them in the autumn of 2001, as that pivotal season began?

The past year, in financial terms, had seen further triumphant success. Turnover had leapt to £86m in 2000-01 and the operating profit, previously a marginal sum, was now £10m. Gate receipts had risen by a third, merchandising revenue by 40 per cent and television income had actually doubled.

There were some flies in this ointment, chief of which was that, despite a great run in Europe, the team had finished fourth in the Premiership and missed the chance of Champions' League football in the coming year. They were in the Uefa Cup, but it was much less lucrative.

There was also the alarming growth of player wages, a relatively new problem but one common to all Premiership clubs. In a single year, wage costs at Leeds had risen by £12m and the total club wage bill, overwhelmingly accounted for by the players, was now £38m. And it wasn't just the expensive purchases who commanded high wages; the young, home-grown players were now starting to come out of youth contracts and were due substantial pay rises.

Then there was the debt. Since the launch of the acquisition policy the end-of-season net debt recorded in the company's books had risen as follows: £9m in 1999; £21m in 2000; £39m in 2001. And that last figure was from June, before the £60m loan showed up in the books. Debt costs money, and the more you have the more it costs.

On the surface, a season that promised rising costs coinciding with the loss of European revenue was a worrying prospect, but the board was convinced the club remained fundamentally strong, that the objective of winning back the European place was realistic (all the more so as Uefa had just awarded England a fourth berth) and that this was not the time to retrench. They had £60m of new cash; what did they do with it?

The first, most pressing business was to clear well over £25m of overdraft and existing bank debt (though not the Ranson deals, which remained). Historic debts as well as the full cost of Rio Ferdinand were thus shifted from short and medium-term accounts to a single long-term one, to be serviced and paid off by that annual payment from the locked box.

Next, the club committed more than £5m to the development of its Thorp Arch training ground and youth academy, providing, among other things, state-of-the-art medical facilities to support the team. Having already signed Robbie Keane from Internazionale for £11m in April, in October and November they bought two more players at the top end of the market, Robbie Fowler for £11m and the Derby County midfielder Seth Johnson for £7m. With that and a few lesser commitments, including topping up some of the players' wages, all the money was gone.

Securitisation deals had unlocked large tranches of new funds for several Premiership clubs, but Leeds had done two things differently. First, they had borrowed more than anyone else, and second, where others used most of this long-term cash for long-term investment, usually on new stadiums or stands, Leeds had spent most of it on the squad.

That season began unevenly for the top clubs, with the Premiership lead changing hands frequently. Leeds fluffed some chances but remained there or thereabouts up to Christmas and then on 1 January 2002, a bright New Year's Day at Elland Road, they went top.

It was not just the score, 3-0 against West Ham, that was remarkable, but the manner of the victory. Two goals came from Viduka, who was at his most imperious, and the third was a chip from Fowler, his sixth goal in four games. And it says a lot about the whole team's performance that neither scorer was man of the match - that honour went to defender Jonathan Woodgate.

Top of the Premiership at New Year: who would bet against Leeds getting back into the Champions' League now? Who could say they wouldn't win the domestic title itself? Everything was on course.

If that 2001-02 season was pivotal for Leeds, the point on which it turned was that first week of January, when a team still glowing from triumph against West Ham travelled south to play Cardiff City in the third round of the FA Cup.

The garrulous O'Leary allowed himself a little bravado. He had asked for the fixture to be played at the Millennium Stadium but the switch was not allowed. 'I'm disappointed. It would have proved excellent preparation for us if we go back there in May,' he said. 'We're well capable of starting and finishing our FA Cup campaign in Cardiff.'

There was to be no return. What happened on the pitch that evening was a disaster for Leeds, with Ferdinand hacked down in the first few minutes and taken off injured, Smith sent off before half-time and Cardiff winning 2-1 with a goal in the 86th minute.

Worse still were the scenes that accompanied the defeat, with bottles thrown, Leeds players assaulted, violence in the stands and police with dogs called in to restore order. O'Leary had to be physically restrained in the face of provocation from the Cardiff chairman Sam Hammam.

Something snapped for good in the Leeds team that night, something that was no doubt linked to the after-effects of the so-called Majestyk affair, the brutal assault on Sarfraz Najeib outside a Leeds nightclub in January 2000 for which Leeds players Woodgate and Lee Bowyer, among others, were tried. The verdicts had come three weeks before, on 14 December 2001: Bowyer was acquitted and Woodgate sentenced to 100 hours' community service for affray.

'That changed the world's perceptions of us,' says Ridsdale now. 'Because it took two years to come to a conclusion and because it was mostly sub judice, during that two-year period nobody talked about it and it was almost like it wasn't there. From the day the court decision was taken the world hated us. They decided that the jury got it wrong; it was our fault. It was almost like, if the lads can't be found guilty the club have to be.'

The first cracks in the relationship between Ridsdale and O'Leary were also beginning to show. More than that, it seemed that a tension which had been holding things together at the club for two years - even pushing the team to high achievement - suddenly gave way.

In the next two months Leeds did not win a single one of their nine matches, a run that included a miserable exit from the Uefa Cup, against PSV Eindhoven, as well as defeats by Chelsea, Newcastle and Liverpool, key rivals in the race for Champions' League qualification.

Fans blamed Brian Kidd, the former Manchester United coach whom O'Leary had appointed to take over training from old Leeds favourite Eddie Gray. Under Kidd's regime, the fans insisted, the team had lost its bite.

O'Leary himself was in trouble, having incurred near-universal condemnation for his book, Leeds on Trial (in public it was seen as crass and insensitive while in private Ridsdale felt he had been let down and some players must have found its portrayal of them patronising).

In interviews at the time, team members hinted at disquiet, with Harry Kewell in particular encouraging doubts about O'Leary's football judgment. (Kewell has since said he sometimes felt 'bamboozled' by his manager's instructions.) Rumour suggested that that the manager had 'lost the dressing room', something unthinkable a year or so earlier during the club's European triumphs.

By March, Leeds were 10 points adrift of fourth place and out of contention for the Champions' League. The five members of the Leeds board met to review the position and what their financial document packs were telling them then, the accounts for the year would later make public.

Net debt reached £82m that June, debt payments were approaching £1m a month and the annual wage bill had jumped by another £10m to £53m. At the same time income was falling, with gate receipts badly down, although a new television rights deal softened the effect. The operating profit of previous years turned into an operating loss of £8m.

Where once all the lines on all the graphs had been going up, now they were going down, with three glaring exceptions: total debt, debt payments due and wages. In plain terms, less and less money was coming in and more and more was going out.

Dramatically, Leeds United had flipped out of a virtuous upward spiral of football success feeding financial success into a fast-moving downward vortex where losses and high wages fed debts, which in turn caused more losses and more debts.

When the accounts became public that autumn one person who recognised this immediately was Bill Gerrard, an economist at Leeds Business School, a fan and an occasional consultant to the club. 'When I saw the figures I could hardly believe it,' he recalls now. 'I calculated then that they were going to need to find £40m to keep trading. In fact I was wrong: they needed £50m.'

'We had a plan B,' says one of the directors, who declines to be named. 'We had the ability to sell players. In the players on our books we had assets worth almost £200m and we could wipe out our debt at any time through judicious sales.'

That spring of 2002, as the team slid down the league, the board approved Plan B and Ridsdale formally told O'Leary that, barring a miraculous change of team form, players would be leaving in the summer. In public he stated that any sales would not involve first-team players.

There is no reason to doubt that this had always been the fallback strategy: sell a few, the logic went, and the books would balance. What happened in the months that followed, however, demonstrated the shortcomings of that logic. Several factors were at work. Some - it is true - are more easily seen in hindsight, but others should have caused the Leeds board anxiety long before they arose.

* Markets go down as well as up. At the time Leeds began to sell, the transfer market as a whole was in decline and, barring a few exceptional cases (such as Ferdinand, for whom a desperate Manchester United paid £26m), most transfers were being done at notably lower prices than previously.

* Players who are playing badly lose value. A bad run for the club doesn't make the player worthless, but if he's a defender leaking goals or a striker not scoring them it is bound to depress his price.

* Sell in distress and you sell at a discount. Rival clubs know you need to do the deal and they will exploit that. The introduction of the transfer windows made this worse, as Leeds became exposed to end-of-window brinkmanship. Players are not slaves. If you want to break a player's contract he may refuse to go, or he may demand compensation.

* And sales are closely related to confidence. Just as buying players boosts a team's ability, resources and morale - the logic embraced by the board in 1999-2001 - so selling them sucks those things out. Not only is the team weaker but it is less willing, less positive, and so more matches are likely to be lost.