Hours after announcing his first all-Tory cabinet, Prime Minister David Cameron has sparked a row with Brussels by rejecting proposals to distribute refugees evenly across Europe.

The move came after Jean-Claude Juncker, the president of the European Commission, put forward legislation to share responsibility for "mass influxes" of non-EU migrants among member states.

Cameron responded by invoking an 18-year-old opt-out to EU asylum policy enjoyed by Britain and Ireland, reported The Times.

"When a new piece of legislation in the area of justice and home affairs - including asylum policy - is proposed, the UK can choose whether or not to participate in it," a government spokesman said. "We will not participate in any legislation imposing a mandatory system of resettlement or relocation."

The commission proposal, which has the support of German Chancellor Angela Merkel, says: "To ensure a fair and balanced participation of all member states to this common effort . . . the EU needs a permanent system for sharing the responsibility for large numbers of refugees and asylum seekers among member states."

Over the past 18 months more than 5,000 migrants, many escaping conflicts in Syria, Libya and Yemen, have died as boats operated by smugglers capsized off Libya. The deaths led to plans for an EU-wide asylum system, alongside search-and-rescue operations in the Mediterranean.

The Prime Minister's tough stance has been attacked by Labour, which supports the controversial quotas scheme, with Claude Moraes, a Labour MEP and chairman of the European Parliament's home affairs committee, saying: "There is low political support for responsibility sharing of refugees, yet such a policy is critical and urgent for the EU."

Diplomats said that using the "nuclear option" of invoking the 1997 opt-out to EU asylum policy could lead to the breakdown of Europe's refugee system over the next year.

"If the UK is to abandon the common European approach to asylum it would have big implications," a diplomat said. "It means, for example, that other EU states might decide not to co-operate with Britain on the return of illegal migrants or asylum shoppers" - where people cross several states before making their claim.

The Home Office said the UK opposes plans for a quota and would instead focus on "targeting and stopping the callous criminals who lie behind this vile trade in human beings... We do not believe that a mandatory system of resettlement is the answer. We will oppose any EU com- mission proposals to introduce a non-voluntary quota".

Commission proposals have been rejected in the past by UK Home Secretary Theresa May as well as some of her European counterparts, including the Netherlands, Denmark, Estonia, Slovakia and Hungary. France is reported to be nervous about the idea.