Image caption Kenya's prisons are notoriously overcrowded

A court in Kenya has ruled that prisoners will be allowed to vote in a referendum on a new constitution.

It is the first time that prisoners in the East Africa nation have been given the right to vote.

The ruling applies only to voting in August's referendum, but correspondents say it may lead to further concessions for future elections.

There will now be a rush to register an estimated 50,000 inmates in time for the referendum.

It is a credible decision KNCHR's Hassan Omar Hassan

The ruling was made after a petition was filed by convicts at Shimo La Tewa Prison in the coastal town of Mombasa.

The Kenya National Commission on Human Rights (KNCHR) welcomed the decision.

"It is a credible decision," said the commission's Hassan Omar Hassan.

"The punishment is supposed to be reformative and when people are incarcerated they lose their freedom but other rights should stay."

Human rights charter

However, the BBC's Will Ross in Nairobi says if the inmates had been hoping to get a day out in order to vote they will be disappointed.

The same ruling stipulated that every prison would become a polling station.

When Kenyan politicians agreed to share power after disputed elections in December 2007, writing a new constitution was part of the deal to end the violence.

The draft constitution provides for greater checks on presidential powers and more regional devolution.

It also recognises the UN human rights charter and creates a second parliamentary chamber - the Senate.