Five suspected Islamist militants have been arrested for planning to attack a Danish newspaper that printed cartoons of the Prophet Muhammad in 2005.
The men wanted to "kill as many people as possible" at the Copenhagen offices of Jyllands-Posten, officials said.
Denmark's Justice Minister Lars Barfoed said it is the country's most serious terrorist plot.
Four suspects - including three Swedes - were held in Denmark, and the fifth was detained in Sweden on Wednesday, police said.
Earlier in December, an Iraqi-born Muslim blew himself up in Stockholm - apparently as he was preparing a suicide bombing, the BBC reports.
Police in Sweden say Wednesday's arrests are not linked to the Stockholm incident.
The four held in Denmark were picked up in raids in Greve and Herlev near Copenhagen, where police found an automatic weapon, a silencer and live ammunition, according to Denmark's security agency, Pet.
Agency chief Jakob Scharf said they had been planning to enter the building housing the newspaper and "kill as many of the people present as possible".
Mr Scharf said an "imminent terror attack" had been foiled and described some of the suspects as "militant Islamists".
The publication of the cartoons, one of which depicted the Prophet Muhammad with a bomb-shaped turban, caused mass protests among Muslims across the world, the BBC reports.
Muslims regard any visual representation of the Prophet as blasphemous.
Kurt Westergaard, the cartoonist who drew the image of the turban bomb, has been honoured with awards by free-speech groups, but he now lives under police guard amid death threats from radical groups.