There were some big names and some even bigger characters at the 1986 Commonwealth Games in Edinburgh.

Steve Redgrave dominated the rowing events, taking three golds. A 20-year-old called Lennox Lewis announced himself in the boxing ring by winning the super heavyweight title. Ben Johnson lorded it in the sprints. Daley Thompson won the decathlon by a huge margin.

But the biggest name of all was not among the athletes. For six weeks of that wet Scottish summer, one individual captured the headlines and the news bulletins, casting his substantial shadow over the Games with his bizarre behaviour and vainglorious pronouncements. Long before he met his end in 1991 when he fell off his yacht, Robert Maxwell had shown his gift for going overboard.

But what was he doing in Edinburgh in the first place? Therein lies a tale of bungling amateurism, administrative shenanigans, political posturing, financial meltdowns and finger-pointing all round. As someone once said, if the answer to a problem was Maxwell, then it had to be pretty serious in the first place.

Edinburgh had established itself as the birthplace of the modern Commonwealth Games when it hosted the event in 1970. Even the name was new, as the competition had previously been known as the British Empire and Commonwealth Games. That year saw the introduction of metric rather than imperial distances and photo-finish technology, but a more significant impact was indicated by the "Friendly Games" tag the event earned. It was a truly joyful occasion.

And a cheap one, too. The budget for Edinburgh in 1970 was £3 million, a figure that would leap to £17m over the next 16 years. But the greatest change lay in sport's wider loss of innocence in that time. By 1986, the purity of competition had to be balanced against an increasingly commercial environment and the fact that politicians were only too happy to use sport as a pawn. Twenty-eight years ago, those factors produced a perfect storm - with Edinburgh, disastrously, at its heart.

Edinburgh had been chosen to host the 1986 Games at a meeting of the Commonwealth Federation at the Moscow Olympics in 1980. The official line was that the award recognised the success of the 1970 Games; the fact of the matter was that no other city wanted them. These were straitened times and the global economic recession put every other city off bidding. Edinburgh still had the infrastructure and facilities that had been put in place 16 years earlier.

So nobody could do it more cheaply. But the political backdrop was probably more important. Three forces were at work.

First, in 1979, Britain had elected a right-wing Conservative government under the leadership of Margaret Thatcher, who would pursue her free market principles with almost messianic zeal. If a city wanted to host the Games it would be flying solo, with no central government support.

Second, the world had also entered the age of the sporting boycott. The USA had refused to take part in the Moscow Olympics, in protest against the Soviet Union's invasion of Afghanistan. The Eastern Bloc would retaliate by staying away from the 1984 Games in Los Angeles, citing "chauvinistic sentiments and an anti-Soviet hysteria being whipped up in the United States".

Third, there was growing opposition to sporting relations with apartheid South Africa. In 1977, the Commonwealth nations had agreed to proscribe any sporting contact, but there was a powerful suspicion among black African countries that the British, and particularly British rugby teams, were paying lip service to the principle. The fast-tracking of British citizenship for white South African runner Zola Budd ahead of the 1984 Olympics strengthened that conviction, as did the Thatcher government's unyielding and unapologetic opposition to any form of economic sanctions against the racist regime.

Thatcher's powerful faith in the free market had been strengthened further by the 1984 Olympics. Effectively, the Los Angeles Games had been in private hands, run brilliantly by the legendary Peter Ueberroth, and had turned in a profit of a quarter of a billions dollars. They, Thatcher decreed, provided the model for everyone else.

But Edinburgh's organisers were not in the same league as Ueberroth's hand-picked panel of big-business "movers and shakers". The organising committee was led by Ken Borthwick, a local confectioner and former Lord Provost. "Borthwick was an old-fashioned small businessman," said former Edinburgh Council leader Alex Wood, quoted in Brian Oliver's recent book The Commonwealth Games - Extraordinary Stories Behind the Medals. "Dithering inaction was his default position."

Malcolm Beattie, who directed the commercial side of the 1990 Games in Auckland, was more scathing. "He showed great deference to the Queen and the establishment, but he didn't really know anything about running a big sports event," said Beattie. "We wanted to know about money, about accommodation, about sponsors - all he talked about was the skirl of bagpipes at dawn. It is beyond nice people who are totally amateur and who are only finding out how to run the Games when the event is halfway through."

Borthwick's committee was a blazeratti cabal of old-school Edinburgh establishment types, a factor that also put them at odds with the recently-elected radical Labour administration of the city. Their chief executive was Blair Grosset, a man who, in the words of a Herald profile at the time, was "a chartered accountant by qualification and nature".

It was a recipe for disaster. It was also a bureaucratic nightmare. When Prince Philip visited the Games headquarters in late spring, he saw a list identifying 384 individuals and 36 committees. "You could get rid of that lot for a start," he thundered.

Their attempts to raise sponsorship were risible. Commercial acumen was almost non-existent. The BBC acquired the television rights for £500,000 when experts suggested they should have paid three times that sum. As the Games loomed, it became clear (despite official denials) that they faced a massive shortfall. Privately, Borthwick wrote to Scottish Secretary Malcolm Rifkind asking for a bail-out. Rifkind refused.

"The 13th Commonwealth Games are rudderless and hapless in a sea of discontent," wrote Chris Brasher in the Observer. Brasher went on to describe Borthwick as "embarrassing" and as "a man who has an amazing ability to score own goals".

It was then that Maxwell entered the fray. It is not clear whether he was invited, or whether he invited himself, but on June 19 he took over as Games chairman, or, as he modestly put it, as Games saviour. The Games still needed to raise another £4m. Maxwell said he could do it.

Typically, he was vague on the details of what he would actually do. At least he was at the start; pretty soon vagueness gave way to outright evasion. Asked repeatedly how much he, individually, or his Mirror Group companies would provide, he dodged the question every time. At one point, he unveiled a Japanese businessman by the name of Ryoichi Sasakawa as a possible benefactor, describing him as a global philanthropist, presumably on the basis that the (rather more accurate) description of Sasakawa as a notorious war criminal would have done little to help the cause.

Maxwell at least added the energy the sluggardly organisers had lacked. But disaster was about to strike. On July 10, two weeks before the start of the Games, Nigeria and Ghana announced they were pulling out in protest against the British government's refusal to impose sanctions on South Africa.

At that point, Maxwell shrugged off the development, but pretty soon he had a major boycott on his hands. By the time the Games got under way, 32 teams, almost 1500 competitors, had withdrawn. Teams even pulled out at the last minute. Bermuda's athletes took part in the opening ceremony at Meadowbank, then returned to their accommodation to find a message ordering them to come home.
 Maxwell blustered. He said he would bill the stay-away nations for £2m. He suggested, despite all evidence to the contrary, that the government could still underwrite the event. He lashed out at Edinburgh City Council for their lack of support. He even went to war with Edinburgh University, suggesting they should forgo payment for the use of the Pollock Halls students' residence for athletes' accommodation.

Yet Maxwell never missed a chance to promote himself or his newspapers. In a report produced after the Games, Coopers & Lybrand estimated the exposure had been worth £4.3m. When the final accounts were prepared, his actual contribution came in at something under £0.3m. He had boasted of his talent as a businessman when he arrived, and in one sense he had actually proven it.

At an early press conference, Maxwell had scoffed at a suggestion that he might be involved in medal ceremonies. Yet when Thompson, the biggest name at the Games, cruised to his predictable victory, Maxwell hoved into view, graciously taking it upon himself to hang gold round Thompson's neck When he presented the Queen with a set of commemorative coins, he brazenly described himself as the man who had made the Games happen. And at the closing ceremony he was quick to take centre stage when the Saltire came away from the flagstaff and he dashed down to the track to attempt to remedy the situation.

To compound all the other problems, the Games were plagued by bad weather. Yet still they went on, and in competitive terms they were judged a success. Yes, the black nations' boycott had the effect of lowering standards, most noticeably in the boxing ring, but, aside from distance running, the higher profile events were largely unaffected.

The Games made stars of Scotland's men's badminton pair Billy Gilliland and Dan Travers. Liz Lynch, later McColgan, was the country's golden girl, winning the women's 10,000m. Girvan-born (but representing Wales) Kirsty Wade won the women's 800m and 1500m.

George Adrain and Grant Knox won the men's pairs in bowls (although Willie Wood, Scotland's finest player, was excluded by official pettifoggery that deemed him to be a "professional").

Those who were there remember the events and the athletes, not the botch-ups in the background. The affair would rumble on. Edinburgh City Council played hardball in pursuit of what they were owed and the company created to run the Games was liquidated. Small creditors were paid in full, others were persuaded to turn debts into donations; more still received only a fraction of what they were owed.

Maxwell, according to Alex Wood, was a man "of monstrous ego, devoid of any desire to serve the greater good, but suffused with an urgent need for power, control and self-aggrandisement." He had come to Edinburgh to sort out a £4m funding shortfall; he left with the debt still standing at £3.8m. After his death in November 1991, the scale of his deceit in other areas, particularly his pillaging of the Mirror Group pension fund, became clear.

But it is still possible - just - to say that he did save the Games. The event was at crisis point before he breezed in and cancellation was a real possibility. If that had happened there might have been no Auckland 1990. No Glasgow 2014. Maxwell left the Games in a bigger mess than he had found them, but he bought them precious time.