File photo - Shakil Dhamed, an Indian Muslim, displays scars on his abdomen after he was stabbed during religious violence that ruled the streets of Ahmedabad for several days, at a makeshift medical centre in the Shah Alam Dargah mosque on March 6, 2002.

A court in India on Thursday sentenced 18 men to life imprisonment over the killing of 23 Muslims during religious riots in the western state of Gujarat in 2002 that left more than 2 000 dead.

Five other men were handed seven-year jail terms for crimes committed when the Hindu rioters entered the village of Ode, bolted the doors of a house where Muslim families had taken refuge and then set it on fire.

Of the 23 who died in what became known as the “Ode massacre”, nine were women and nine children.

“The court found 18 men guilty of murder and criminal conspiracy, and five men stand guilty for attempt to murder,” Judge Poonam Singh said.

The violence in Gujarat in 2002 was triggered by the killing of nearly 60 Hindu pilgrims travelling in a train that was torched by a mob.

About 31 Muslims were found guilty last year on murder and conspiracy charges for the train attack, which sparked an anti-Muslim backlash.

Hindu mobs hungry for revenge rampaged through Muslim neighbourhoods across Gujarat during three days of bloodshed that witnessed some of India's worst religious violence since independence from Britain in 1947.

More than 2 000 people, most of them Muslims, were hacked, beaten or burned to death.

Gujarat's Chief Minister Narendra Modi - a prominent member of the Hindu nationalist Bharatiya Janata Party - was blamed for failing to stop the riots, with some critics arguing that he actively encouraged the violence.

Earlier this week an investigation team appointed by India's Supreme Court cleared Narendra Modi of such allegations as they found no evidence against him.

The Ode massacre was one of several cases probed by a Supreme Court-appointed special investigation team. - AFP