Trade unions have reacted with fury after a surprise move in the Queen's Speech which threatens to cost them millions of pounds.

Changes to union subscriptions were slipped into a new Bill announced yesterday.

Union leaders accused ministers of a "shamelessly partisan attack" on funding to the Labour party, in the wake of the landslide Tory victory.

But the row comes at an awkward time for Labour.

The party is currently in the early stages of picking a new leader following Ed Milliband's resignation and will not want that process to be overshadowed by another row about union funding.

Unions had already been braced for what they described as an assault on workers' rights as the Tories set out their legislative programme.

The new Tory Business Secretary Sajid Javid has already said that he wants to tighten up the rules around strikes, among other measures.

But there was also the unexpected move on funding.

The Conservative election manifesto had pledged legislation to ensure trade unions use a "transparent opt-in process for union subscriptions".

But the Trade Unions Bill also added the words "for the political fund element".

Unions collect millions of pounds from their members every year for political funds, including those not affiliated to Labour.

A total of 13 unions are affiliated to Labour, including the biggest in the UK such as Unite, Unison and the GMB.

The schemes can raise millions of pounds for the party.

A Downing Street spokesman said: "No-one is suggesting that you should be able to opt in or opt out of paying your union subscription. If you are members of the union you pay your subscription.

"The only debate is about the political levy and that is a debate that has been going on for decades and so I think it's pretty well understood.

"At the moment you are supposed to be able to opt out. There is already concern that at the moment that isn't being spelled out very clearly to new members. Our approach is that there should be a conscious decision of opting in.

"An opt-in already exists in Northern Ireland. So it is not an alien concept.

"There has been a long debate about it, we put it clearly in our manifesto, we were elected on that manifesto.

"Clearly some union leaders may not be very happy about it but that doesn't mean it's not right."

A Unite spokesman said: "The Tories are taking Britain back to the 1920s with this shamelessly partisan attack on the funding of the opposition party.

"Political funds are already subject to approval being given in regular ballots by unions. Tory hedge fund and multimillionaire donors will face no similar restrictions, leaving boards free to write hefty cheques backing the Tory Party.

"Absent from the Tory manifesto, there is zero popular mandate for this move which is just one more attack on working people. It is clear there is no place for trade unions in Cameron's 'one nation'."

Paul Kenny, the general secretary of the GMB, said: "This is just the same old Tories who are anti-trade union and anti-working people having a voice.

"It's one rule for the Tory slush fund, hedge funds and another for trade union members.

"This will not deter or silence the voices of millions of working people who have already given their approval for political funds through democratic ballots governed by statute.

"It will bring state funding for political parties a step nearer. It is not sustainable to allow the elite and companies unfettered and unlimited rights to fund the Tory Party while shackling the bodies that have funded the political opposition to them for more than a century."

A Labour Party spokesman said: "On the union opt-in, we support measures to ensure increased transparency and have already introduced reforms to Labour Party processes to reflect this.

"Any proposals from the Government must be done in a fair non-partisan way and which doesn't rig things in favour of the Tory Party."

Skills minister Nick Boles said: "The Conservative Party manifesto made a clear pledge to reform the trade union rules on union subscriptions.

"Even Ed Miliband backed the principle of opting in for trade unions affiliating members to the Labour Party. Political donations should be voluntary and there is a clear case for greater transparency."