Image copyright Alamy Image caption Die Toten Hosen in 1989

When music captures the spirit of freedom it can cross any border. In 1961, Communist East Germany built a wall across Berlin, and tried to seal itself off from the West. But new research shows how concrete, barbed wire and a huge effort by the secret police, the Stasi, failed to silence the seductive beat of rock and roll and punk.

The rise of Beatlemania in the 1960s brought a scathing response from Walter Ulbricht, the leader of the German Democratic Republic (GDR).

"Do we really have to copy all the rubbish that comes from the West… with all the monotony of their 'Yeah, yeah, yeah,'" he sneered during one of his turgid speeches to the Communist Party faithful.

He was 70 years old and in some ways his comments weren't so different from those of many Western politicians, says Dagmar Hovestaedt, a senior figure at the BStU, the organisation investigating the archives of the East German secret police, the Stasi.

"The older generation, the war generation, was aghast at what youth was doing," she says.

Punk rock didn't officially exist in the East - they didn't want to spread the virus in any form Campino, Lead singer of Die Toten Hosen

But for East Germany's leaders, much more was at stake. They feared that love of Western music would lead to love of Western politics. So they desperately tried to develop "their own version of cool youth culture".

There were state-planned dance steps, such as the Lipsi, an attempt to prevent the rise of rock and roll dancing. There was also a ludicrous and much ignored quota system restricting how much Western music could be played at parties. But "you can't organise a youth culture," Hovestaedt says. "That's not how it works."

Which is why many young East Germans remained glued to their radios, trying to catch the latest tunes beamed in by Western stations, and the Stasi did what it could to stop them.

Image copyright Getty Images

Find out more

Listen to Rocking the Stasi on Music Extra, on the BBC World Service

on Music Extra, on the BBC World Service Click here for transmission times, or to catch up later online

If there's one story that symbolises GDR paranoia about music - and the tragedy of being a young music fan there - it's the story of a Rolling Stones concert that never happened.

It all began in 1969 with a throwaway comment by a DJ on the radio station RIAS - based in West Berlin but much listened to on the other side of the Berlin Wall. Imagine, he said, if the new publishing house built by entrepreneur Axel Springer in the West, right next to the Wall, staged a concert featuring the Stones on its roof so Easterners could come and listen too.

Image copyright BStU Image caption Stasi photographs of crowds in East Berlin gathering to hear the Rolling Stones

In East Germany the DJ's notion quickly became rumour and then widely believed fact. Thousands of young East Germans convinced themselves that the Stones really would play. And, what's more, on the same day their rulers were planning a day of celebrations in East Berlin to mark the 20th anniversary of the GDR's founding.

Cue panic among the Stasi. They hated Springer - seen as a capitalist ogre bent on luring young people away from the communist faith. Their files from the time are full of things like photographs of slogans chalked on roads in East German towns telling Stones fans to come to Berlin - and reports detailing how the Stasi tracked down and arrested the subversive sloganisers.

Image copyright BStU

But hundreds did still come to Berlin on the day. I met Eckart Mann, then a 16-year-old, at the same spot opposite the Springer building where he'd waited in 1969. He'd heard the rumour, and thought, "Stones, play here. Wow, wow, wow!"

In fact, the Stones never appeared, but the GDR authorities did. As the crowd moved towards the Brandenburg Gate the policed arrived, and Mann was beaten and arrested.

He was convicted of being an "anti-socialist element". In his files I discovered that the head of the Stasi, Erich Mielke, had taken a personal interest in his case. Mann was given two years in prison, then expelled to the West, away from his family.

Image caption Eckart Mann, near the spot where he was arrested 48 years ago

"What was prison like?" I ask. He shrugged. "Not OK, but what could I do?" he says. And so a teenager paid a bitter price for his love of music.

That kind of brutal reprisal was meant to deter all young East Germans from dancing to Western "imperialist" tunes.

But the hunger for Western music just grew - reaching places a long way from the big cities.

Image copyright BStU Image caption Young people suspected of listening to Western music, secretly snapped by the Stasi (1969)

Another teenager, Alexander Kuehne, was desperate to bring more music into his life in a remote village hours from Berlin. What about getting hold of the latest Western records? As pensioners - not seen as vital to the state - were allowed by the GDR regime to visit the West, he'd give his grandmother shopping lists. It didn't go well. She misread The Clash and came back with Johnny Cash - you can still see the pain in Alexander's face as he recalls this "huge nightmare".

So instead he decided to turn his village into a major music venue.

It happened to be near a major rail junction, and he persuaded all kinds of music fans and bands to head for the room behind the village pub.

"This place is where we made the biggest parties in East Germany," he says, as he shows me round. Farmers at the bar would look on bemused as hundreds of New Wave fans or Glamrockers headed past them - with up to 1,000 packing a hall meant, according to police regulations, to hold only 100.

As it was so remote the police and Stasi were slow to react to these huge gatherings - apart from on one occasion when Alexander was arrested, taken to a police station and told the Stasi would come for him the next day. "I was very frightened," he says.

Image caption Alexander Kuehne in the pub today

Luckily for him his mother had once taught the local police officer. She ordered him to release her son, and then dealt with the Stasi when they arrived. She never told her son exactly what happened. "She's my hero" is all he says now, with quiet admiration.

But back in the big cities pressure from the Stasi was relentless on music fans seen as "subversive" and "anti-social".

I remember visiting East Berlin in the early 1980s, seeing a few punks on the streets, and thinking you've got to be brave wearing slashed clothes, safety pins and spiky hair when the regime wanted you parading in a socialist youth group uniform.

Image caption Berlin's Stasi Museum displays the police mugshot of an arrested punk

But how could the secret police deal with or even understand something like punk? The archives contain recordings of Stasi meetings where the organisation's boss Erich Mielke tried to get his brain - and his tongue - around such utterly baffling concepts as punks and heavy metal fans.

The aim was to control 'the scene' as it expanded, to stop it from becoming too well known Jürgen Breski, Ex-Stasi officer

I managed to track down Jürgen Breski, then a Stasi officer ordered to monitor and infiltrate the punk scene. He agreed to meet in a discreet corner of a city-centre restaurant and tell me what his bosses had wanted him to do.

"They wanted to bring a kind of socialist lifestyle to the people so we tried to combat anything that didn't belong to that," he says. "The aim was to control 'the scene' as it expanded, to stop it from becoming too well known."

In the end the Stasi did what it always did -recruited as many informers as possible.

Other tactics including calling up members of illegal bands for compulsory military service and sending them to different parts of the country. "Suddenly the band had no musicians," Breski says.

Image copyright Alamy Image caption An outdoor punk concert in East Berlin (1985)

But many were determined to resist. Dirk Kalinowski from the punk band Zerfall told me how the Stasi put heavy pressure on him and his band.

They survived as performers thanks to an extraordinary alliance with a Berlin church which gave them shelter. The GDR authorities, mostly ruthless, were wary of attracting international attention by interfering directly with church activities.

I could see right into the faces of the congregation who were completely shocked Dirk Kalinowski, Zerfall

The church, he says, was a "protected space".

"They could arrest you as you arrived in front of the door or as you left. But here inside you were safe."

So his group - banned by the state from normal concerts - was able to perform in the middle of Evangelical church services. The pastor would pause… and then ask his mostly elderly congregation to listen to something just a bit different.

"It was mad," Kalinowski remembers. "As front man I could see right into the faces of the congregation who were completely shocked. The only ones who were laid back about it were the children who jumped up straight away. I'll never forget it - one old couple covered their ears and then walked out."

A church also provided the venue for another extraordinary concert, when British music producer Mark Reeder managed to smuggle a West German punk band, Die Toten Hosen, across the Berlin Wall to play a concert.

Image copyright Mark Reeder Image caption Mark Reeder before the fall of the Wall

"I told my friends, 'If I get caught I get thrown out of the country. If you get caught your lives will change because you'll be classed as enemies of the state,'" recalls Reeder. "They said, 'We don't care we'll do it anyway.'"

Campino, lead singer of Die Toten Hosen, remembers how the band disguised themselves to get through border controls between West and East Berlin. "We had to comb our hair, get proper clothes on." He knew why the East German authorities would stop them if they recognised them. "Punk rock didn't officially exist in the East, they didn't want to spread the virus in any form."

Only around 25 could come to the secret concert in an East Berlin church. But "everyone in the room know this was something very special and maybe would never happen again".

Image copyright Getty Images Image caption Campino performing with the Toten Hosen in 2015

He was very impressed, he says, with the way young East Germans created their own cultural space in spite of - or perhaps because of - all the regime's pressure.

"They had a certain kind of pride, a belief. They said, 'You in the West you've got the best clothing, the fashion, all those things. But we've got friendship and we help each other and we're not superficial,'" he says.

Their friendships "meant more because they had to pay a bigger price for everything that went wrong", as he puts it.

And so this amazing musical life rocked on - soundtrack to a kind of freedom that few outsiders ever realised was possible. Yes, the regimes could impose all kinds of restrictions. But still music fans created free spaces, a unique state of mind across communist-ruled Europe.

Image copyright Getty Images Image caption Mikhail Gorbachev and East German leader Erich Honecker sing the International in East Berlin (1986)

From the mid-1980s, as a new leader in Moscow, Mikhail Gorbachev, began loosening the Soviet grip on East Germany, Western music was reverberating more and more strongly around the Berlin Wall itself.

In 1987 no less a figure than David Bowie played a concert right by the Wall on the Western side - Bowie a global star who'd lived in Berlin, knew its surreal Cold War atmosphere and musical energy well. And fans from the East gathered near the Wall to try and listen.

Image copyright Denis O'Regan/Getty Images

For the relatively young deputy police chief of East Berlin, Dieter Dietze, this posed a professional and personal dilemma. He knew a brutal police response - like that against those who'd come hoping to hear the Rolling Stones in 1969 - would be counter-productive. And as a rock fan himself who'd once played in a band, he told me he had much sympathy with the young fans. But GDR bosses still wanted order above all.

"It was clear to me that music, rock music belonged to young people, that there was no way you could deny that to young people. So I and a couple of others began to argue - why don't we do something like this?" he says.

The GDR authorities were persuaded to allow concerts on their territory by global superstars including Bob Dylan and, in 1988, Bruce Springsteen. It was meant as a safety valve to appease the younger generation. But the concerts just amplified a new spirit of freedom.

Image copyright BStU Image caption A Stasi report on the Dylan concert struggles with the name of Tom Petty's band

Concerts like Bruce Springsteen's, says Dagmar Hovestaedt, "became a rallying point for demands for human rights, for access to travel and to express yourself. Imagine - 100,000 young East Germans singing 'Born in the USA'."

Image copyright Alamy

Whereas in the 1960s Rolling Stones fans hoping to hear their heroes had faced persecution, "in the 80s that fear had gone, the state had lost control".

There are many reasons, political and economic, why the Cold War came to an end. But that spirit of freedom that brought thousands on the streets in 1989 to challenge communist regimes was also vital.

And that spirit had been sustained - for many - by music.

Image copyright Alamy

After the Wall came down and the GDR disappeared so too did the Stasi. Former officers like Jürgen Breski have had much time to reflect on their attempt to control everything - and why it failed.

"From today's perceptive much seems pointless, a waste of effort," he told me. When it came to punk music "sometimes we had influence, but in the end there were no results" .

And what about the young people persecuted, sometimes imprisoned, for their love of music?

"Today I'd be against doing something like that. But you grow up in a society, grow with this society's norms, you profit from them. And when later you have the chance to see that from a different perspective you say: 'OK - it shouldn't have been that way.'"

Concrete borders, machine guns and barbed wire could stop some things. But not music.

"Music comes into your spirit and your head and you listen," says Dagmar Hovestaedt. For her, it all goes back to an old German proverb: Die Gedanken sind frei - thoughts are free.

"Music that can't be stopped by borders reminds you constantly there is joy in self-expression."

Click here for the BStU report on the 1969 Rolling Stones concert that never was (in German)

Join the conversation - find us on Facebook, Instagram, Snapchat and Twitter.