Facing terror with music, tens of thousands gathered in squares across Norway to sing a children's song that gunman Anders Behring Breivik claimed is being used to brainwash young Norwegians.

The defiant Facebook protest against the right-wing fanatic took place as survivors gave tearful testimony Thursday in his trial for the July 22 bombing-and-shooting rampage that killed 77 people, mostly teenagers.

Some 40,000 people converged at a central square in Oslo in the pouring rain to sing the 1970s song Children of the Rainbow — a Norwegian version of American folk music singer Pete Seeger's Rainbow Race. The singers were joined by Norwegian artist Lillebjoern Nilsen who played the song.

In testimony last week, Breivik mentioned the tune as an example of how he believes "cultural Marxists" have infiltrated Norwegian schools and weakened its society.

Later, the crowd marched to the Oslo courthouse where they laid a carpet of red and white roses on the steps and the fence.

Reached at home in Beacon, N.Y., the 92-year-old Seeger told The Associated Press he had heard about the mass gathering from Nilsen, who called him Thursday morning.

A woman places a flower near the entrance of a courthouse where Anders Behring Breivik's trial is conducted, as thousands of people turn up in poor weather at Youngstorget Square to sing a popular children's song. (Heiko Junge/NTB Scanpix/Reuters)

"I said, 'Oh that's wonderful,"' Seeger said. "It's a tremendous honour, really. One of the greatest honors a songwriter could have is to have a song of theirs sung in another country."

Seeger and his music have been central in myriad social justice causes from civil rights to the environment. He sang out against the Vietnam War and more recently joined the Occupy Wall Street protest in Manhattan.

Breivik has admitted setting off a bomb last July 22 outside the government headquarters that killed eight people, and then going on a shooting rampage at the Labor Party's annual youth camp on Utoya island, killing 69 others, mostly teenagers.

Shocked by Breivik's lack of remorse for his massacre, many Norwegians by and large have decided the best way to confront him is by demonstrating their commitment to everything he says he loathes. Instead of raging against the gunman, they have manifested their support for tolerance and democracy.

"We have a quiet majority that sometimes gets a bit too quiet," said Shoaib Sultan of The Norwegian Centre against Racism. However, he said it was important to "demonstrate tolerance."

Eskil Pedersen, the head of the Labor Party's youth wing, told the umbrella-decked crowd in Oslo that Thursday's song held special significance for his group. "We aren't here because of him, but because of each other," Pedersen said.

Breivik's defence lawyer Geir Lippestad said his client was aware of the singalong protests.

"He has registered that there is something going on outside this place, but he has obviously not seen it with his own eyes," Lippestad told public broadcaster NRK at the courthouse.

Survivors testify

In court Thursday, people who survived Breivik's car bomb in Oslo's government district gave emotional testimony as he listened expressionlessly.

Breivik waits to have his handcuffs removed in a courtroom during his trial in Oslo on Thursday. (Hakon Mosvold Larsen/NTB Scanpix/Reuters)

Anne Helene Lund, 24, was just seven metres from the explosion. Afterward, she was in a coma for a month and when she woke up she had lost her memory, unable to even remember the names of her parents.

"I studied political science for three years, now I have to relearn social studies at the junior high school level," she told the court.

Her father, Jan Henrik Lund, also took the stand. Fighting tears, he described his emotions at seeing his daughter with severe life-threatening brain injuries.

"It was like experiencing the worst and the best in the same moment," he said. "It was fantastic that she was alive, horrible that she was as injured as she was."

Breivik says he was targeting the governing Labor Party, which he claims has betrayed the country by opening its borders to Muslim immigrants. He has shown no remorse for the attacks, which he coldly described last week in gruesome detail.

Since he has admitted to the attacks, Breivik's mental state has been the key issue for the trial to resolve. If found guilty and sane, Breivik would face 21 years in prison, although he can be held longer if deemed a danger to society. If declared insane, he would be committed to compulsory psychiatric care.

Breivik said Wednesday that being declared insane would be the worst thing that could happen to him because it would "delegitimize" his views.