European Union leaders who met without Britain at a summit in Bratislava today have agreed to work out a "vision" for the bloc's success by next March after the shock Brexit vote.

The meeting of 27 leaders in the Slovak  capital issued a roadmap for improving the way it deals with migration, security and the economy, to be approved in Rome in March for the 60th anniversary of the EU's founding treaties.

"We committed in Bratislava to offer to our citizens in the upcoming months a vision of an attractive EU they can trust and support," read the so-called Bratislava Declaration issued by the leaders.

"We are confident that we have the will and the capacity to achieve it.

"The EU is not perfect but it is the best instrument we have for addressing the new challenges we are facing. We need the EU not only to guarantee peace and democracy but also the security of our people."

The leaders said they were determined to move forward despite Britain, one of its largest members, voting in a referendum on 23 June to exit the EU.

"Although one country has decided to leave, the EU remains indispensable for the rest of us," the declaration said, adding that the EU had secured "peace" after "wars and deep divisions on our continent."

"We are determined to make a success of the EU with 27 Member States, building on this joint history."

Analysis: EU defence floats to the surface in aftermath of Brexit

Britain cannot get access to the EU's single market unless it also accepts the freedom of movement of workers that lies at its foundation, the EU's top officials also said after the summit.

"We want to have very good, very close relation with the UK. At the same time, it is not possible for these negotiations to damage our interests," the head of the executive European Commission Jean-Claude Juncker said.

"Concerning the freedom of movement of workers and of persons ... we are sticking to that position and this is not a game between prime ministers leaving and prime ministers remaining, this is about people in Europe," Mr Juncker said.

"So I cannot see any possibility of compromising on that very issue," he said.

Earlier German Chancellor Angela Merkel and French President Francois Hollande pledged to work together to make a "success" of the bloc after Brexit.

"Germany and France will very intensively play their part in the coming months in order to make all this a success," Ms Merkel said at a rare joint press conference with Mr Hollande after the 27 EU leaders met.

Mr Hollande said Europe could only move forward after Britain's shock vote to leave if it identified clear priorities that "meet the expectations of Europeans."

He continued: "France and Germany will continue to work so that we can deliver concrete measures."

France and Germany produced a joint defence plan in the run-up to the summit.

Speaking on his way into the meeting, Taoiseach Enda Kenny said the meeting was supposed to be about the EU and not Brexit.

"I have made the point to the other leaders that if Europe becomes obsessed with what might or might not be the end point of discussion with the United Kingdom, then Europe will not be doing itself justice.

"This is the European Union, 27 countries, and we should be able to make decisions about where we want the union to be in five, 10, 25, 50 years hence, and any other countries who want to join, the rules and regulations are there."

Hollande, Juncker, Kenny

Although the leaders of the 'EU 27' met just before the regular June summit in Brussels to consider the outcome of the Brexit referendum, this is the first time they have convened a specific summit to look at the future they will face when Britain leaves.

Immigration and the control of Europe's borders was one of the key issues for discussion, as was combating terrorism - particularly in the wake of the Paris and Brussels attacks.

Defence co-operation, particularly in defence industries and procurement, is being strongly promoted by Italy, France and Germany, while for other states making their workforce feel more secure in the face of a globalising economy is the priority.

Mr Kenny also said the issue of migration and border security was a key issue for many states, particularly in southern Europe, while defence co-operation was another key area.

He said Ireland's main focus would be on economic aspects of the further development of the EU, adding that Ireland has always contributed to European co-operation, taking into consideration Ireland's red line issues on neutrality, and will continue to contribute to co-operation. 

Meanwhile, Ms Merkel earlier warned that the EU faces a "critical situation".

"We are in a critical situation. We have to show with our actions that we can get better," Ms Merkel told reporters.

She said the bloc had to improve "in the domain of security, internal and external security, the fight against terrorism, the cooperation in the field of defence".

The EU had to "get better in the issues of growth and jobs," she added.