Berlin, Germany (CNN) -- Four men were convicted in Germany on Thursday in connection with a foiled terrorist plot against Western targets, court officials said.

The men had begun mixing a huge amount of explosive material that could have resulted in a strong blast, bigger than attacks in 2005 on London's public transport network and the 2004 Madrid railway bombings, authorities said.

Three of the men -- two Germans and a Turk -- were arrested in September 2007. The other was arrested later.

The Germans -- Fritz Gelowicz and Daniel Schneider -- were sentenced to 12 years in prison. Turkish citizen Adem Yilmaz received 11 years. Attila Selek, a German citizen of Turkish descent, received five years.

Gelowicz, Schneider and Yilmaz were convicted of, among other things, being members of a terrorist organization, court officials said.

The men had joined the Islamic Jihad Union in 2006.

Selek received a shorter sentence because he was convicted only of supporting the organization.

Three of the men had trained at camps in northern Pakistan with the group that had ties to al Qaeda, German authorities said.

The group said it wanted to target the Ramstein Air Base and other U.S. and Uzbek military and diplomatic installations in Germany, German authorities said.

The group also wanted to force Germany to stop using an air base in Uzbekistan as a stopover point for moving equipment and personnel in and out of northern Afghanistan.

-- CNN's Frederik Pleitgen contributed to this report.