BERLIN (Reuters) - A German court sentenced four far-right militants to between three and five years behind bars on Wednesday for forming a “terrorist association” with racist and anti-Semitic aims and planning to attack refugees.

In the last two years, during which more than a million migrants have arrived in Germany, authorities have tried to crack down on right-wing groups who have stepped up attacks on foreigners.

The three men and one woman were part of the “Oldschool Society”, founded in 2014, whose roughly 30 members pursued racist, anti-Semitic and anti-Muslim goals, said the Munich court in a statement.

After becoming increasingly radicalized during 2015, they planned bomb attacks on foreigners and in particular on asylum shelters, said the court.

Two of the members acquired illegal explosives in the Czech Republic and brought them to Germany, keeping them in one of the men’s homes. The arrests of the four in June 2015 prevented the attacks from taking place, said the court.

Prosecutors had sought prison sentences of up to seven years. The court said the sentences were softer because the Oldschool Society was not in a position to pose much of a threat, due in part to a lack of funds.