Soccer in the United States was dying a slow, painful and largely unnoticed death in 1975. Five years since the North American Soccer League (NASL) began, the game had barely registered on the public's radar. "Soccer," said one writer, "was just a game played by Commies and fairies in short pants". Even in New York, the most ethnically diverse metropolis on the planet, there was little appetite for the game and the city's own franchise, the New York Cosmos, were, according to their American goalkeeper Shep Messing, "drawing less than the skin flicks on Eighth Avenue".

Owned by Warner Communications, the New York Cosmos were, like many other franchises, a team going nowhere fast. A ragbag assembly of students, foreigners and part-timers, they played their football at a high school athletics ground in front of row after row of empty seats. Nobody knew about them, let alone cared.

Thirty years ago today, all that changed, thanks to the indomitable spirit of one man, the financial muscle of another and, of course, the global reputation of Pele, the world's greatest player. At a chaotic press conference at the Big Apple's famous presidential hang-out, the 21 Club, the Cosmos announced the transfer coup of the century when they unveiled the three-times World Cup winner as their latest recruit. "We had superstars in the United States but nothing at the level of Pele," says John O'Reilly, the club's media spokesman. "Everyone wanted to touch him, shake his hand, get a photo with him."

Five days later, Pele made his Cosmos debut at the crumbling Downing Stadium at Randall's Island (the locals called it "Vandal's Island"). Situated under the Triborough Bridge, Downing was a dump. Broken bottles littered the field, there was no running water (apart from the overflow from the toilets above the locker rooms) and there was more grass on the road into Manhattan than on the pitch. For Pele's debut against the Dallas Tornado, the groundsman Stan Cunningham even spray-painted the pitch green when he heard CBS would be covering the game. "Pele had this sort of green fungus on his leg," recalls Clive Toye, general manager and later president of the Cosmos. "He thought he had caught a disease in his first 45 minutes playing in New York but all it was the green paint coming off."

Before Pele came to town, soccer games had only ever really been covered by junior reporters, often as some kind of punishment. Now, though, there were over 300 journalists at Downing, including David Hirshey, Cosmos correspondent for the New York Daily News. "Pele was a diamond in a rhinestone setting," he says. "It was inconceivable that he would play his first game in a place that was essentially a bunch of dirt and rocks left over from the Palaeolithic era."

The impact of Pele's signing was seismic. Before, they had given away tickets with Burger King vouchers and bumper stickers. Now, they had to lock the gates when the ground reached its 22,500 capacity. "There must have been another 50,000 turned away," remembers the Cosmos coach Gordon Bradley.

Like Toye, Bradley was an Englishman who had been with the Cosmos from their inception in 1970. After an unspectacular playing career that had taken him from Sunderland to Bradford Park Avenue and on to Carlisle United, he now found himself coaching the greatest player in the history of the game. "It was a joy ride," he recalls. "I remember the first practice. A cross went behind Pele's head and he was running toward the goal. He jumped up in the air and did a bicycle kick, and scored. The press couldn't believe it. I ended the practice right then."

The Cosmos squad also had trouble adjusting to the fact they were now sharing a pitch with Pele. "The biggest challenge for us," explains Werner Roth, then captain, "was not stopping and watching him play."

Pele's signing marked the end of a four-year odyssey for Toye, a former chief football writer for the Daily Express. He, together with the NASL's Welsh commissioner Phil Woosnam, had traversed the globe in pursuit of the Brazilian, stealing meetings with him in hotel rooms and taxi cabs and doing their utmost to persuade him his future lay not in a comfortable retirement. "I told him that he had to come to America because he would have the chance to do something no one else could do - make soccer a major sport in the USA," recalls Toye. "He later admitted he had no idea what the hell I was talking about."

Though the missionary role certainly appealed to Pele, so too did the financial rewards, not least as they would help extricate him from some serious financial problems back in Brazil. Bankrolled by Warner and their charismatic chairman Steve Ross, Pele earned more in his three years in New York than he had in his entire career with Santos. And to ensure he paid as little tax as possible, Warner prepared a succession of contracts for him, with only one having any mention of soccer in it. One even had his position in the corporation as "recording artist" with the Warner subsidiary Atlantic Records. "We owned him lock, stock and barrel," says Toye.

Pele's arrival not only signalled a wholesale reversal in the fortunes of the team but in the perception of the NASL as a viable alternative to the mainstays of baseball, basketball and American football. As well as publicising a league in dire need of a fillip, he brought instant credibility to the standard of the game in the States, even if the quality overall did not justify the inflated salaries of some imports.

Suddenly, a club run by five people out of an inadequate office on Park Avenue transformed into an organisation struggling to cope with countless media requests and ticket orders every week. Every last facet of the club needed overhauling. In days, the Cosmos had more than 50 support staff to help capitalise on Pele's arrival. Where once the press conferences would take place in the locker room with a handful of hacks passing the time before the bars opened, now they were held in the 21 Club or the ballroom of the Plaza Hotel, with scores of journalists enjoying the trappings of a club heading for the big time.

Even the buffet improved, as Jamie Trecker, the Cosmos' PR director, recalls. "Before Pele got to the Cosmos, you'd only have five or six journalists at a press conference and you'd serve finger sandwiches and maybe you'd open a couple of bottles of soda if it was really high end. After Pele signed, the basic food was caviar and smoked salmon and champagne."

By 1977, the Cosmos had dropped the New York prefix and moved to Giants Stadium in New Jersey, where more stellar recruits (including Franz Beckenbauer, Carlos Alberto, Giorgio Chinaglia and Johan Neeskens) would join what had become the most glamorous team in world football. Though the front pages of New York's papers were hogged by the city's battle against bankruptcy or by another Son of Sam murder, the back pages were now reserved for the Cosmos. "We transcended everything, every culture, every socio-economic boundary," maintains Messing. "We were international, we were European, we were cool, we were Americans from the Bronx. We were everything to everybody."

On the road the Cosmos sold out every game ("like travelling with the Rolling Stones," says the club's travelling secretary Steve Marshall). In New York they were media darlings, idols of 77,000 fans (including Mick Jagger, Henry Kissinger, Robert Redford and Steven Spielberg) and virtual residents at Studio 54. In two years, they became an organisation with the cultural visibility no other arm of the Warner portfolio could boast. It mattered not that the club did not make a single cent in their 15-year history. The Cosmos had become the hottest ticket in town; Ross even had a seat belt installed in his spot in the upper tier, just in case he got overexcited and toppled over the edge.

When Pele played his last game at Giants Stadium on October 1 1977 it marked the beginning of the end, not just of an era but of the Cosmos and the NASL. Without anyone of Pele's stature to take it on, soccer's popularity nosedived and within a year crowds fell, the all-important television deal with ABC was lost and players headed back to Europe as salary caps were enforced. By 1985, the NASL was dead.

Pele's final game for the Cosmos was a friendly against Santos. Having played the first half for the New Yorkers (scoring from 30 yards), he switched sides at the interval. As the game progressed, the heavens opened, drenching all the 75,000 congregation. The next day a Brazilian newspaper ran the headline: "Even the Sky Was Crying."

·Once in a Lifetime The Incredible Story of the New York Cosmos was written by Gavin Newsham and is published by Atlantic Books on July 4, priced £8.99