A potentially damaging split at the top of the Conservative party has been laid bare after the attorney general issued a warning saying Britain's role as an international advocate for human rights would be jeopardised if David Cameron defied a European court ordering a right to vote for some prisoners.

The attorney general, Dominic Grieve, said Britain would be throwing away one of its great prizes as a soft diplomatic power – including its ability to persuade authoritarian states not to beat up its citizens in police cells – if it were seen to defy the European court of human rights.

He did so as Cameron, at prime minister's questions in the house, insisted his government would never give the prisoners the vote, and suggested his government might table a motion to the Commons ruling out compliance.

The government has until 22 November to respond to the European court ruling. Chris Grayling, the justice secretary, is the lead cabinet figure.

Downing Street officials claimed that a fresh government vote, setting out reasons why the ruling was being defied, might satisfy the European court.

It was claimed that Grieve might agree with this view, but his appearance at a justice select committee hearing on Wednesday gave no such hint.

The fear for Cameron is of some senior government members resigning if he openly defies the court. Government officials, desperate to keep a lid on the row, said no option, including a draft bill, had been ruled out.

Some parts of the government are arguing that relatively small changes could be made to the Representation of the People Act to comply with the ruling, and believe that they have cabinet support for a draft bill that would allow parliament to come to a considered view.

Grieve, giving evidence to the justice select committee, defiantly refused to back down in his belief that the government should comply with a ruling which he said gave ministers flexibility as to how it was implemented.

He said: "The blanket ban is in breach of the convention (European convention on human rights). The UK government is an adherent to the convention and the convention is one of the international legal obligations. Successive governments, including this one, has always put a great emphasis on our adherence to international legal obligations.

"We live in a world where international law matters increasingly and the UK has always been a role model in areas of international law."

He then raised the stakes by claiming that defiance would damage the government's international standing.

He said: "The UK has an enviable reputation in relation to human rights standards and adherence."

He added that while attorney general he had "done a good deal of travel outside of Europe, most of it connected with rule of law agenda, trying to persuade countries that have poor human rights to put in place structures so that human rights are respected, that police don't beat people up in prison cells and that standards are raised.

"We are the forefront of this. If was I trying to identify an area of benevolent soft power the UK has to offer, it is one of our great prizes. Inevitably, if we were to be in default of judgment of the European court of Human rights it would be seen by other countries as a move away from human rights norms."

He said parliament was sovereign and free to respond as it wished to the court ruling, but added "the accepted practice is that the UK observes its international obligations and that is something that is set out in a number of places including the ministerial code".

If Britain was in breach of the court, it would be open to prisoners to sue the UK government for compensation, and for the Council of Europe to expel the UK.

He suggested the court had given the UK great flexibility as to how it implemented its ruling and that it might be possible to give the vote only to prisoners who went on "a civil responsibility course", or were released on licence.

He added that it might be possible to deprive the vote from some individuals handed non-custodial sentences for breaches of electoral law. He also accepted some prisoners, such as fine defaulters, already had the vote.

"I'm simply stressing that there are numerous ways a government or parliament could approach the issue of change to the blanket ban," he said.