In the 1982 World Cup in Spain Algeria shone – before being sent home by one of the most cynical ploys ever to disfigure the competition

It was the best of times, it was one of the worst of footballing crimes. On their first appearance at the World Cup, Algeria made an impact that changed the tournament forever. They produced one of the most exhilarating performances to defeat one of the favourites, West Germany, but were then sabotaged by one of sport's most blatant cases of match-fixing.

The 1982 World Cup had opened with a surprise, the holders Argentina losing 1-0 to Belgium, but a far bigger shock was to follow. In the first match of Group 2, the mighty West Germany would surely crush the unknown novices from Algeria. That, at any rate, was the German attitude.

The reigning European champions had stomped imperiously into the finals, winning all eight qualifiers with a goals for-against record of 33-3. They had a constellation of stars in their squad – Paul Breitner, Karl-Heinz Rummenigge, Uli Stielike and so on – and were so certain of victory over Algeria that they entertained themselves in the pre-match press conferences by ridiculing their opponents. "We will dedicate our seventh goal to our wives, and the eighth to our dogs," quipped one player, while the manager, Jupp Derwall, promised that if his team contrived to lose he would "jump on the first train back to Munich".

"One player even said that he would play against us with a cigar in his mouth," recalls Algeria's full-back Chaabane Merzekane, who, as it transpired, was made man of the match. "Some of us wondered if this was just a psychological ploy, whether they were only saying these things to lull us into thinking that they weren't going to take us seriously – after all, who has ever heard of a German team that doesn't do its homework?"

The thing was, this German team really had not done their homework. Derwall confessed after the match that he had been provided with a video of Algeria in action but did not order the players to watch it because they would have laughed at him. Chances are that if they had bothered to view the tape, they would not have spent the build-up cracking jokes. Because they would have been forewarned about a team that had qualified by winning home and away against Nigeria, and prepared for the finals with impressive friendly wins over the Republic of Ireland, Real Madrid and Benfica. The Germans might also have noticed that, apart from their skill and speed, Algeria played with formidable fluency and a rare dynamism, the fruit both of the players' familiarity with each other – all had been playing together for years and most were based at home, Algerian law at the time prohibiting players from leaving the country before the age of 28 – and of an energising sense of historical duty.

These players, after all, were the heirs of those who in 1958 had given up professional careers in France to participate in Algeria's war of independence. The football team created by Algeria's resistance movement, the Front de Libération Nationale, travelled the world, showcasing Algerian spirit and skill and serving as a powerful propaganda tool in the fight for freedom. When the country finally attained independence in 1962 the FLN team composed the core of the new national side.

"Because of this history, the bond between the Algerian national team and our people is uniquely strong and we took the comments by the Germans before the game as a slur on our population," the striker Lakhdar Belloumi says, pointing out that several former FLN players were part of the coaching staff in 1982, including Abdelhamid Zouba and the co-manager Rachid Mekloufi.

"We had our parents at home, but we players also considered that we had our parents with us at pitch-side," Belloumi explains. "Those guys from the FLN were like our second fathers – in their day they abandoned fame and fortune to fight for their country and we were carrying on that fight. We were already a tight-knit group, but we were given extra motivation by the Germans, especially as we were very conscious that 1982 was the 20th anniversary of our independence. We were determined to uphold the dignity of our people."

Germany were about to be jolted. "We went out to attack them, to play with our style: Algerian vivacity," Merzekane says, who personified this style more than anyone, forcing Breitner on to the back foot with barnstorming breaks from deep. "We knew he liked to attack, that he was the best in the world at it, so we set out to exploit that – that was part of our tactical triumph. But we also dominated them technically and physically." Dominated is an exaggeration, but certainly Algeria were the better team in the first half and deserved their opening goal when it came in the 54th minute, Rabah Madjer finishing off a sweeping break.

Rummenigge equalised in the 67th minute, but if the Germans thought order had been restored, they were wrong. From the restart a nine-pass Algeria move ended with Belloumi arriving unmarked to slam the ball in from close range. "That was the finest moment of my career," says Belloumi, who after the tournament would receive permission from the Algerian government to accept a transfer to Italy, only for the move to fall through.

"It was the perfect goal, one of the best moves of the whole tournament," says Merzekane. "And after that we didn't hang on, we continued to attack and we could have won by three or four." It finished 2-1.

Merzekane's swashbuckling performance left ITV's commentator Hugh Johns almost breathless with admiration. "He's one of the discoveries of the World Cup!" gushed Johns, offering an accurate assessment even if it was only the third day of the tournament, and the full-back could have added a goal himself, when in the 88th minute he slalomed from his own box into the German area before being foiled by the goalkeeper Harald Schumacher. "It was a lung-bursting run and more proof that we were fitter and stronger than the European champions," says Merzekane. "But that wasn't a surprise to us – in those days there were no visa issues so as teens many of us had travelled and played against Europeans. We knew they were not better than us."

At the final whistle there were raucous celebrations in Gijón's El Molinón stadium and all over Algeria. West Germany was plunged into mourning. "This feels like the sinking of the Titanic," declared the Süddeutsche Zeitung. Algeria's players resisted the temptation to rub their noses in it. "We respected the German team and we respected their country, we were just delighted that we had also made them respect ours," says Belloumi.

The euphoria lasted for days and left them drained and, to their cost, a trifle complacent for their next game, against Austria. They lost 2-0.

"That's where we showed our inexperience," says Belloumi. "We should have kept a cool head before that game and probably changed a couple of players but, in fairness to the Austrians, they had studied our style and knew we could be vulnerable on the counterattack." In contrast to Derwall's wilful ignorance, Austria's manager, Georg Schmidt, had been monitoring Algeria since the Africa Cup of Nations in Libya earlier that year. Fabio Capello, whose England team take on Algeria in Cape Town on Friday, would never make the same mistake as Derwall.

Algeria recovered their vivacity for the final group game against Chile and quickly swept into a 3-0 lead. In a helter-skelter second half the South Americans struck back twice. "Again we showed our inexperience, we should have seen that match out and preserved our three‑goal lead," Belloumi says. Merzekane disagrees. "Some say we should have stopped attacking but we had come to the World Cup to show the Algerian style and we weren't about to start playing defensively."

The 3-2 victory still meant Algeria would become the first African team to reach the second round unless the group's final game, to be played the following day, ended in a one- or two-goal win for West Germany over Austria, in which case both the European teams would progress at Algeria's expense. In the 10th minute of that match Horst Hrubesch put the Germans in front. Then … nothing happened. Realising the scoreline suited both of them, Germany and Austria effectively stopped playing. In the ensuing 80 minutes there were no shots, and barely any tackles, crosses or sprints. The game was no longer a contest, it was a conspiracy. The teams' cynicism provoked universal scorn.

A smattering of Algerian fans in the Gijón crowd burned peseta notes to show their suspicions of corruption, while most of the Spaniards in attendance waved hankies throughout the second half in a traditional display of disdain. The next day newspapers in Spain denounced "El Anschluss" and there was outrage in Wst Germany and Austria too. Eberhard Stanjek, commentating for the German channel ARD, almost sobbed during the match as he lamented: "What is happening here is disgraceful and has nothing to do with football. You can say what you like, but not every end justifies the means." The Austrian commentator, meanwhile, told viewers to turn off their sets and refused to speak for the last half-hour. Former West German international Willi Schulz branded the German players "gangsters".

The gangsters, however, were unapologetic. When German fans gathered at the team hotel to protest, the players responded by throwing water bombs at them from their balconies.

Even less bothered was the head of the Austrian delegation, Hans Tschak, who made these extraordinary comments: "Naturally today's game was played tactically. But if 10,000 'sons of the desert' here in the stadium want to trigger a scandal because of this it just goes to show that they have too few schools. Some sheikh comes out of an oasis, is allowed to get a sniff of World Cup air after 300 years and thinks he's entitled to open his gob."

Did the Algerian players take offence? Not at all, Merzekane says. "We weren't angry, we were cool," he says. "To see two big powers debasing themselves in order to eliminate us was a tribute to Algeria. They progressed with dishonour, we went out with our heads held high."

From all over the world came calls for Fifa to punish the Europeans or stage a replay, but in the end all the world's governing body did was rule that henceforth the last pair of games in every group must be played simultaneously. "Our performances forced Fifa to make that change, and that was even better than a victory," Belloumi says. "It meant that Algeria left an indelible mark on football history."