COPENHAGEN, Denmark — 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.

Also on HuffPost:



AL QAEDA'S MOST WANTED:
Loading Slideshow...
  • Osama Bin Laden

    Al-Qaeda's Saudi leader was killed in an American raid on May 1, 2011. (AP Photo, File)

  • Ayman al-Zawahri

    Ayman al-Zawahri became <a href="http://www.foxnews.com/us/2012/04/29/5-most-wanted-al-qaida-leaders/" target="_hplink">al Qaeda's new leader</a> after the death of Osama bin Laden. He is believed to be hiding in Pakistan and regularly releases propaganda videos. (AP Photo/SITE Intel Group)

  • Abu Yahia Al Libi

    Abu Yahia al Libi was al Qaeda's <a href="http://www.huffingtonpost.com/huff-wires/20120429/us-al-qaida-top-5/" target="_hplink">de facto no. 2</a> after the death of Bin Laden. He escaped a high-security U.S. prison in Bagram, Afghanistan, in 2005 and <a href="http://www.huffingtonpost.com/2012/06/05/abu-yahia-al-libi-drone-strike_n_1569772.html" target="_hplink">was killed</a> in a strike in Pakistan in June 2012. (AP)

  • Nasser al-Wahishi

    Al Wahishi was once bin Laden's <a href="http://www.huffingtonpost.com/huff-wires/20120429/us-al-qaida-top-5/" target="_hplink">aide-de-camp</a> and now commands AQAP, al Qaeda in the Arabian Peninsula . (AFP/GettyImages)

  • Ibrahim Hassan Al Asiri

    Saudi Ibrahim Hassan al Asiri is <a href="http://www.huffingtonpost.com/huff-wires/20120429/us-al-qaida-top-5/" target="_hplink">believed to be responsible </a>for building uilding the underwear bomb used to try to bring down a Detroit-bound jetliner on Christmas 2009, as well as the printer-cartridge bombs.

  • Said AlMasri

    Al Qaeda's number 3 was <a href="http://www.huffingtonpost.com/2010/05/31/al-qaeda-number-three-reported-killed_n_595561.html" target="_hplink">killed</a> in an American drone strike May 2012. (Reuters TV)

  • Fazul Abdullah Mohammed

    Mohammed was <a href="http://www.huffingtonpost.com/2011/06/11/fazul-abdullah-mohammed-dead_n_875363.html" target="_hplink">killed</a> by the Somalian army in June 2011. He led the organization in Eastern Africa. (AP)

  • Abu Musab Al-Zarqawi

    Al Qaeda's leader in Iraq was <a href="http://www.huffingtonpost.com/2010/04/19/two-top-al-qaeda-figures-_n_542653.html" target="_hplink">killed</a> in a U.S. airstrike in 2006. (AP Photo/U.S. Department of State, HO)

  • Khalid Sheikh Mohammed

    Mohammed, the <a href="http://www.huffingtonpost.com/2012/05/06/khalid-sheikh-mohammed-trial_n_1489527.html" target="_hplink">self-described mastermind</a> of the attacks of 9/11, was captured in Pakistan in 2011 and is held at Guantanamo Bay. (AP Photo/FBI)

  • Saif Al Adel

    Al Adel was Bin Laden's former <a href="http://www.huffingtonpost.com/huff-wires/20120229/ml-egypt-arrest/" target="_hplink">security advisor</a>. He is still on the run. (Getty Images)

  • Adnan El Shukrijumah

    El Shukrijumah is responsible for Al Qaeda's external operations. He <a href="http://www.huffingtonpost.com/2010/08/06/adnan-shukrijumah-new-al_n_673164.html" target="_hplink">lived in the U.S.</a> for more than 15 years. (FBI)

  • Atiyah Abd al-Rahman

    Al-Rahman was Al Qaeda's liaison for Iraq, Iran and Algeria until he <a href="http://www.huffingtonpost.com/2011/08/27/atiyah-abd-al-rahman-al-qaeda-dead_n_939009.html" target="_hplink">was killed</a> on August 22, 2011 in Pakistan. (AP Photo/National Counterterrorism Center)