An attempt to give some prisoners a say in the independence referendum has been defeated.

Deputy First Minister Nicola Sturgeon, backed by Labour and Tory politicians, said convicted prisoners should be refused a vote while in custody.

"I'm not yet persuaded of the case that is being made, although I'm sure it's an issue we will continue to debate until this Bill reaches its final stage," she said.

"The Government doesn't believe that convicted prisoners should be able to vote while they're detained in custody.

"We hold that view for reasons of principle, for reasons of law, but also for reasons of consistency."

She responded to calls from Green and Liberal Democrat MSPs who believe the system breaches human rights.

Both parties opened the issue for debate during scrutiny of the Scottish Independence Referendum (Franchise) Bill which has the principle aim of reducing the voting age limit to 16.

It also seeks to confirm the voting arrangements for elections, which exclude prisoners.

Ms Sturgeon rejected a range of proposals on prisoner voting during discussions at Holyrood's Referendum Bill Committee.

The European Court of Human Rights has ruled that the UK Government must present plans for allowing prisoners to take part in elections, with a direct impact on Scotland.

The UK Parliament is expected to tackle the issue in the next few months but Prime Minister David Cameron has vowed inmates would not be given voting rights under his administration.

Opening the debate at Holyrood, Green co-leader Patrick Harvie said extending the vote would help rehabilitate prisoners.

Failing to address the issue now only stores up problems for the next election, he argued.

"I suspect that if the Government continues to resist amendments in this area, that will go to court," he said.

"I regret the fact that we seem likely to have, instead of a couple of weeks of unfortunate headlines in the newspapers about prisoners getting the right to vote, instead of that we're probably going to have months of legal process instead. I think that's a shame."

Lib Dem Alison McInnes said the existing blanket ban violates prisoners' rights.

"We know that ruling does not apply directly to the referendum but falling back behind that argument I think is weak," she said.

"It's a way of avoiding what is an important issue. The UK is already out of step with much of Europe."

It would be reasonable to start with short-term prisoners, perhaps those serving sentences of six months of less, she argued.

Labour MSP James Kelly said his party does not support the proposal.

"What is missing in this debate is the voice of victims of crime," he said.

"Any MSP who's close to what is going on in their constituency, particularly urban constituencies, will be aware that low-level crime such as antisocial behaviour may be termed low-level in the debates in the chamber in Parliament but can have really stressful impact on families and individuals and communities."

Accepting the proposal would be a disservice to victims and send a worrying signal, he said.

SNP MSP Stewart Maxwell said the Green-Lib Dem positions lack logic.

"There is a rather simple point here," he said.

"The bottom line is that if you want to retain your vote in the referendum, don't go and commit crime. It's pretty simple. Don't steal people's cars, don't create violence in the streets, don't do the things that will end up with you going to prison.

"That's a choice individuals make. If they make that choice then they must suffer the consequences. That's the view I think of society and it's certainly one I support."

Conservative Annabel Goldie said: "I have a fundamental disagreement in principle with what both Patrick Harvie and Alison McInnes propose, which is why I won't deal with the detailed aspects of the arguments which they presented."

Meanwhile, a former chief inspector of prisons has argued that inmates should be given the vote.

The Very Rev Dr Andrew McLellan, the Chief Inspector of Prisons for Scotland from 2002 to 2009, said respect for the law is the ''most significant reason'' for at least some prisoners being allowed to vote.

The ban has ''no punishment value'', he said.

''It is inconceivable that anyone has ever been persuaded not to commit a crime by the threat of being forbidden to vote,'' he said.