BERLIN (AP) — A German court convicted three 17-year-olds on Tuesday of participating last year in a bomb attack on a Sikh temple that was motivated by hatred of other religions. They were given prison sentences ranging between six and seven years.

The boys had been radicalized for some time before the April 16 attack in the western city of Essen and had been in contact with ultraconservative Muslims known as Salafists, the Essen state court said.

But the three-month trial turned up no evidence that they had any immediate contact with the Islamic State group, the court said in a statement.

Two of the defendants, identified only as T. and B., were convicted of attempted murder and bodily harm. The court found that they placed a home-made bomb — a fire extinguisher filled with explosives — outside an entrance the temple.

A cleric suffered a broken foot and several other people suffered cuts. The temple's door was destroyed and window frames ripped out.

T., who set off the explosion, was sentenced to 7 years in prison, while B. was sentenced to six years and nine months. The court said that the youths, who fled the scene, had bought the ingredients for the explosives and the detonator online.

The third defendant, identified only as I., wasn't at the scene of the bombing or involved in making the bomb. However, the court found that he had agreed with the other two to carry out an attack and had suggested the Sikh temple as a possible target.

He was convicted of conspiracy to murder and given a six-year sentence.

The boys were tried as juveniles in a trial from which the media and public were excluded. All three lived in or near Essen.

The court said that T. and B. largely admitted during the trial to their involvement in the explosion and to having being radicalized, but said they hadn't intended to kill anyone. I. denied involvement.