BERLIN (AP) — A German court handed lengthy prison sentences Monday to four Islamic extremists over plots to bomb a train station and kill a far-right politician.

The Duesseldorf regional court found Marco G., whose surname wasn’t published in line with privacy laws, guilty of attempted murder for placing an explosive device at the main train station in the western city of Bonn in December 2012.

Although the homemade bomb was discovered and defused before it detonated, the court said the 30-year-old German convert to Islam deserved a life sentence due to the seriousness of the crime, the dpa news agency reported. It ruled out his release after 15 years, the usual life term in Germany.

He and three others were also found guilty of forming a terrorist organization and planning to kill a member of the far-right Pro NRW party who had taken part in protests against mosques during which caricatures of the Muslim prophet Muhammad were shown.

Judges sentenced Albanian citizen Enea B., 46, German-Turkish dual national Koray D., 28, and German citizen Tayfun S., 27, to between 9½ years and 12 years in prison.

Prosecutors said the men’s plan was partly fueled by an audio message disseminated by the Islamic Movement of Uzbekistan. They were arrested in March 2013, the night before the planned killing.

Their lawyers had asked the court to acquit the men, according to dpa.