A blueprint for Britain's future in Europe has been published in Brussels, setting out plans for an "emergency brake" on benefits for migrant workers, as well as measures to give national parliaments more power to block EU laws.
The draft proposals, released by European Council president Donald Tusk following intensive discussions with David Cameron and UK officials, pave the way for an in/out referendum in June, provided it is agreed by all 28 national leaders at a crunch Brussels summit on February 18-19.
As expected, the document proposes measures to improve EU competitiveness, a 55% threshold for national parliaments to force the EU to alter or scrap proposed laws, as well as assurances that the rights of non-eurozone states will be protected as the single currency area integrates.
It states in law for the first time that the euro is not the EU's only currency and that the commitment to "ever-closer union" does not oblige all member states to "aim for a common destination". It makes clear that non-euro states are not required to help bail out single currency members which get into trouble, and proposes a new mechanism for non-euro states to "escalate" concerns about possible discrimination in favour of the eurozone for discussion by the full European Council, as the Prime Minister has demanded.
In a key gain for Home Secretary Theresa May - tipped as the most senior Cabinet minister still weighing up whether to campaign for Brexit - the document makes clear that EU states are entitled to refuse access "on preventative grounds" to individuals likely to threaten national security, even if the threat is not imminent. And it includes provisions for member states to tackle the use of fraud or sham marriages to gain the right to enter and remain.
Crucially, the proposed emergency welfare brake will allow national governments to impose a four-year restriction on new EU migrants claiming in-work benefits, if the number of incomers is imposing a strain on its public services and welfare system.
But Mr Tusk's document leaves open the question of how long the brake can remain in place, and what period it may be extended for if the problems persist.
In a measure which is likely to be seized upon by Eurosceptics, it proposes that migrant workers should be allowed to have benefits phased in over the four-year period, rather than facing an outright ban.
It states that host nations should continue to pay benefits to migrant workers for children in their home country, but says that states like the UK should be given the right to cut payments to a level in line with the standard of living in the country where the child lives.
A country wishing to apply the "alert and safeguard mechanism" will have to notify the European Commission that "exceptional" levels of immigration are affecting "essential aspects" of its social security system, causing "serious" problems in its jobs market or putting "excessive pressure" on public services.
The approval of national leaders meeting in the European Council would be required for the brake to be applied.
But, in a key concession to the Prime Minister, a draft commission statement attached to the nine-page document states that the UK is already in the kind of "exceptional situation" which would allow it to trigger the brake immediately "in the full expectation of obtaining approval".
The draft blueprint makes clear that the proposals would come into force immediately after the UK votes in favour of remaining in the EU.
Certain elements of the plans will be incorporated into EU treaties "at the time of their next revision", but a new treaty would not be needed for them to come into effect.