Two Danish brothers originally from Somalia were given four weeks of pre-trial detention Tuesday after they were arrested by Denmark's security service on suspicion of plotting a terror attack.
The older brother, aged 23, was also suspected of having received terror training from the Somali militant group al-Shabab, the PET security service said.
He was arrested late Monday at Copenhagen's international airport as he arrived by plane from an undisclosed location. At the same time, his 18-year-old brother was arrested in the city of Aarhus, in western Denmark, PET said.
Authorities "cannot say with certainty that a terrorist act was imminent, but we felt that it was necessary to intervene and arrest them at this time to be able to thwart the plans," PET head Jakob Scharf said.
Both men pleaded innocent at a custody hearing Tuesday.
Al-Shabab relies on several hundred foreign fighters _ some with experience in Iraq, Afghanistan and Pakistan. It joined al-Qaida earlier this year, and seeks to recruit new soldiers from Somali communities overseas.
U.S. and European officials fear that young recruits from Somali immigrant communities in the U.S. state of Minnesota, Britain, and the Nordic countries could train in Somalia and return to carry out attacks.
PET head Jakob Scharf said that between 25 and 40 people "with connections to Denmark have received training or taken part in militant activities with al-Shabab in Somalia," and at least two people with connections to Denmark have committed suicide attacks in Somalia.
The two brothers _ who cannot be named under a court order _ came to Denmark 16 years ago and are Danish citizens, the agency said. The investigation had been ongoing for a long time when authorities moved to arrest them.
PET said the men had been talking about methods, targets and different types of weapons and were believed to be "in the process of preparing an act of terror." The agency left Denmark's terror alert level at "serious," saying this particular threat had been averted.
The 23-year-old had been at an al-Shabab training camp in Somalia from Jan. 18 to Feb. 21, prosecutor Lone Damgaard said. He was the first person in Denmark charged with receiving training with the aim of committing an act of terror.
The charges, which are preliminary, were read out at the Aarhus City Court behind closed doors, as is customary in terror cases.
"We are shocked that some young people who have lived in Denmark for the past 16 years decide to travel to Somalia to make contact with al-Shabab," said Abdirahman M. Lidle, a spokesman for an umbrella association of 13 Somali groups in Aarhus.
Lidle said he was not sure if he knew the men. "There are 500 to 600 young Somalis in Aarhus and we cannot know everything," he said.
Denmark has been in the crosshairs of Islamist terror groups since the publication of newspaper cartoons depicting the Prophet Muhammad in 2005, an act that offended many Muslims.
A Somali man living in Denmark was convicted of terrorism and sentenced to 10 years in prison after breaking into the home of one of the cartoonists with an ax in 2010.
Last year, a Chechen-born man was sentenced to 12 years in prison for preparing a letter bomb that exploded as he was assembling it in a Copenhagen hotel in 2010.
Another trial is under way in Denmark against four men accused of plotting a shooting spree at another Danish newspaper.
PET's former operations chief, Hans Joergen Bonnichsen, said previous terror suspects arrested in Denmark have had no experience or training. He said he believes the latest arrests were related to the Muhammad cartoons.