A Spanish court has convicted two men of killing a homeless woman by setting her on fire and sentenced them to 17 years in prison.

The court in Barcelona has found the men guilty of aggravated homicide in the death of the 50-year-old woman in 2005. At the time, both men were 18.

Prosecutors said the woman was trying to sleep inside a bank lobby next to an ATM machine when the suspects drenched her with a flammable solvent and set it ablaze with a cigarette.

The suspects told the court they did not mean to kill the woman, just harass her. But the court said Tuesday they had acted with malice and knew their actions had "a very high probability" of killing her.

An other suspect, 16 at the time, was convicted earlier and sentenced to eight years.