David Cameron is to risk a backbench rebellion over opting back in to the European arrest warrant after he announced he will stage a Commons vote on the issue before the vital Rochester and Strood byelection.

Ed Miliband offered to give over Labour debating time to stage the vote, but Cameron pre-empted him by saying the government had already decided to do so itself.

Cameron told Miliband: “There’s only one problem with your question, which is we are going to have a vote, we are going to have it before the Rochester byelection. Your questions have just collapsed.”

The prime minister’s spokesman said no precise date had yet been agreed for the vote – Labour had suggested next Wednesday – and argued it did not make any difference to the wider political scene whether it was held before or after the byelection.

As many as 100 Tory backbenchers could rebel, but Cameron should get the measure through with the support of Labour and the Liberal Democrats.

The government has agreed to opt out of the justice and home affairs measures, but to opt back in to 33 specific elements including the European arrest warrant.

The EAW needs to be agreed by 1 December. The home secretary, Theresa May, who has been meeting backbenchers on the issue, believes the rebellion can be contained.

If the Tories were to lose the byelection to Ukip, and the EAW vote was staged afterwards, the rebellion could be even larger.

In another prime minister’s questions dominated by Europe and immigration, Cameron said the government was just waiting for the Spanish government to sign up and insisted the arrest warrant was “very different” from previous versions.

He said the new version gave British judges discretion to reject warrants and not to allow individuals to be extradited if there was going to be a long period of detention. He said the changes negotiated represented the biggest transfer of powers back from Brussels to Britain.

Miliband, after accusing Cameron of being paralysed by fear of his backbenchers, responded to Cameron’s unexpected announcement by saying: “We look forward to voting together – two parties working together in the national interest, or one and a half parties working together in the national interest.”

Cameron has agreed to opt back in to 33 EU justice and home affairs measures. Most require approval only by the EU’s executive, but half a dozen need agreement from all member states.

Among the other laws the UK wants to re-adopt is a prisoner transfer agreement, membership of Eurojust – the bloc’s judicial cooperation unit – and a system allowing British nationals to be bailed back to the UK.

Spain argues the UK should also join up to other laws, including a DNA, fingerprint and vehicle registration database, but the UK government has said it will not do so. Spain claims the database is essential to fighting terrorism and organised crime.

It is not clear if the Spanish disagreements are due to the principles at stake or part of a proxy war over the long-running dispute over Gibraltar.

Miliband also reminded Cameron that he had made a pledge in a contract with the British people to reduce net immigration to the low tens of thousands and had asked voters to throw him out if he failed to meet the objective. Net migration is currently 243,000.

Cameron countered that he had inherited a total and utter shambles in migration from the previous Labour government, adding that the Labour opposition was a total mess.

He said Britain was a victim of a successful economy both in terms of the EU labour market and the recent EU demand that the British government pay an extra £1.7bn to the EU budget due to the strong performance of the UK economy relative to the rest of the eurozone

He said: “The eurozone could go into its third recession in six years. We are not immune from that. We are the victims of the success of our economy in comparison with the eurozone.”