Five Islamic extremists have been caught as they planned to massacre staff at the Danish newspaper that printed cartoons of the Prophet Mohammed.
The men, arrested in a security service operation, intended to shoot as many people as possible at the Jyllands-Posten daily in Copenhagen .
Denmark's intelligence service held four men in two raids in suburbs of the capital and seized an automatic weapon, a silencer and ammunition.
Swedish police said they arrested a 37-year-old Swede of Tunisian origin living in Stockholm.
"An imminent terror attack has been foiled," said Jakob Scharf, head of the Danish Security and Intelligence Service, known as PET. He described some the suspects as "militant Islamists with relations to international terror networks" and said that more arrests were possible.
PET said it seized a 44-year-old Tunisian, a 29-year-old Lebanese-born man and a 30-year-old who were living in Sweden and had entered Denmark late Tuesday or early Wednesday. The fourth person detained was a 26-year-old Iraqi asylum-seeker living in Copenhagen.
The Danish intelligence service said the group had been planning to enter the newspaper office "to kill as many of the people present as possible."
The four men face preliminary charges of attempting to carry out an act of terrorism. They will face a custody hearing tomorrow.
Zubair Butt Hussain, a spokesman for the Muslim Council of Denmark, called the plan "extremely worrying."
The organisation "absolutely condemns any act of terrorism regardless of the motives and motivations that may lie behind," he said.
There have been at least four plots to attack against Jyllands-Posten or Kurt Westergaard, the artist who drew the most contentious of 12 cartoons, which were published by the daily in 2005 as a challenge to perceived self-censorship.
"The foiled plot is a direct attack on democracy and freedom of press," Mr Westergaard said. "We may not and won't let anyone forbid us to criticise radical Islamism. We may not be intimidated when it comes to our values."
In January a Somali man broke into Mr Westergaard's home wielding an axe and a knife but the artist escaped unharmed by locking himself in a safe-room. In 2008, two Tunisians with Danish residence permits were arrested for plotting to kill him.
In September, a man was wounded when a letter bomb he was preparing exploded in a Copenhagen hotel. Police said it was intended for the daily, which has also been targeted in a number of thwarted terror plots in Norway and the United States.
The cartoons also provoked massive and violent protests in 2006 in Muslim countries where demonstrators considered the drawings as having profoundly insulted Islam. Islamic law generally opposes any depiction of the prophet, even favourable, for fear it could lead to idolatry.
In 2008, the Danish Embassy in Islamabad, Pakistan, was targeted by a car bomb that killed six people outside.
The attacks and threats have caused concern and unprecedented security measures in Denmark, a country that prides itself on personal freedom and openness.
The JPPOL media group building, which includes Jyllands-Posten, is protected by metal fences and guards at all entrances. Mail is scanned and newspaper staff need identity cards to enter the buildings and the various floors.
Lars Munch, JPPOL chief executive, said his workers were worried.
"It is appalling for our group, for our employees and their families to see their workplace threatened," he said.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies