* Summit will set negotiating terms for talks in June
* Rare unity among 27 states - before talks start
* Fear of Brexit contagion makes for tough terms
* Some worry "punitive" tone could risk wrecking deal
By Alastair Macdonald
BRUSSELS, April 29 (Reuters) - European Union leaders will endorse a stiff set of divorce terms for Britain at a summit on Saturday, rejoicing in a rare show of unity in adversity, but well aware that may start to fray once negotiations begin.
Meeting for the first time since British Prime Minister Theresa May formally triggered a two-year countdown to Brexit in late March, the 27 other EU leaders will lose little time over a lunch in Brussels in approving an 8-page set of negotiating guidelines hammered out by their diplomats over the past month.
Those will bind Michel Barnier, their chief negotiator, to seek a deal that secures the rights of 3 million EU expats living in Britain, ensure London pays tens of billions of euros Brussels thinks it will be owed and avoids destabilising peace by creating a hard EU-UK border across the island of Ireland.
They also rule out discussing the free trade deal May wants until they see progress on agreeing those key withdrawal terms.
In a mark of how last year's Brexit vote has called into question the unity of the United Kingdom itself, leaders will also offer Irish Prime Minister Enda Kenny a pledge that if Northern Ireland, which voted against Brexit, ever unites with his country, it will automatically be in the EU.
The leaders may spend more time in discussions, including with Barnier, on what criteria they may use to judge, come the autumn, whether he has made sufficient progress to warrant a start on trade talks. They may also talk about how to manage a transition, after Britain leaves in 2019, to a new relationship likely to take many more years to finalise.
That decision on what is "sufficient" is the kind of debate that can poison relations as the 27 seek to protect national interests. Also contentious will be which countries scoop the prizes of hosting two EU agencies set to be moved from London.
With most of the 27 offering to house the European Medicines Agency (EMA) and several wanting the European Banking Authority (EBA), summit chair Donald Tusk and EU chief executive Jean-Claude Juncker will propose they agree in June on criteria for making the choices to avoid a repeat of previous bunfights.
"We are remarkably united," one national leader who will be at the table told Reuters this week. "But then it's always easy to be united on what you want before you start negotiating."
Among possible differences, the priorities of poor, eastern states are to secure residency rights for their many workers in Britain and British money for the EU budget; Germany and others set store by a smooth transition to a new free trade agreement.
Unwonted unity has been forged by the shock of Brexit; it breaks a taboo and raises fears of further break-up at the hands of nationalists like French far-right leader Marine Le Pen. She will contest her country's presidential election run-off on May 7, though few expect her to beat centrist Emmanuel Macron.
The EU sees it as vital that Britain not be seen to profit from Brexit to avoid encouraging other states to follow suit.
However, some officials are also voicing concern that the process of weaving maximalist demands into the negotiating text could risk souring the atmosphere with May, who expects to start talks shortly after the UK election she has called for June 8.
Senior officials in Brussels believe the risk of a breakdown in talks that could see Britain simply walking out into chaotic legal limbo in March 2019 has diminished since May wrote to Tusk on March 29 in terms recognising she would have to compromise.
But German Chancellor Angela Merkel, facing her own election in September, warned Britain this week against lingering "illusions" of how much access it would retain to EU markets.
And some diplomats fear the tone of EU negotiating demands could sound too aggressive and create a popular backlash in Britain that might then make it hard for May to agree a deal.
"These are legally solid arguments," one said, noting for example a demand Britain not only lose the EMA and EBA but also pay the moving costs. "But we don't want to sound too punitive."
(Additional reporting by Jan Strupczewski, Farah Salhi, Philip Blenkinsop and Foo Yun Chee; Editing by Mark Trevelyan)