European Union leaders have warned that the UK must honour the principle of free movement of people if it wants to retain access to the single market after it leaves the bloc.
European Council President Donald Tusk said the UK could not pick and choose.
The French and German leaders also made clear that the freedom of movement of EU citizens was non-negotiable.
Immigration to the UK, particularly from poorer EU countries, was a key issue in the referendum campaign.
Some campaigners for Leave sent a clear message that the vote was about controlling immigration levels.
Outgoing UK Prime Minister David Cameron said that the issue of freedom of movement would be for the next PM and government to decide.
"I'm in no doubt that this is the difficult issue," he told MPs in Westminster.
"Frankly, it's a difficult issue inside the EU, where you've got all the negotiating ability to try and change things, and I think it will be in many ways even more difficult from outside."
EU leaders appear united after Wednesday's meeting that there will be no "nuances", as European Commission President Jean-Claude Juncker put it, for the UK.
Mr Tusk said there would be another meeting of EU leaders, again excluding the UK, on 16 September in Bratislava to discuss the so-called "Brexit".
Mr Juncker said there would be no discussions whatsoever with representatives of the UK on a possible post-Brexit relationship until the UK had formally notified the EU of its intention to leave by invoking Article 50 of the Lisbon Treaty.
There could be "no negotiation without notification", he said.
The leaders of the 27 member states, excluding Britain, said in a statement that they hoped to have the UK as a close partner of the EU in future "and we look forward to the UK stating its intentions in this respect.
"Any agreement, which will be concluded with the UK as a third country, will have to be based on a balance of rights and obligations. Access to the single market requires acceptance of all four freedoms."
The "four freedoms" that underlie the EU's internal market are the freedom of movement of goods, workers, services and capital.
French Finance Minister Michel Sapin told BBC Newsnight that once Britain had made its proposals, "everything" would be on the table.
"We will negotiate all these aspects with a desire to come to an agreement."
But Britain would not be in the same position as it was beforehand, he said.
"We return to zero."
At the scene: Laurence Peter, BBC News, Brussels
The 27 leaders, now minus the UK, made it clear that the EU has to regroup, rally its forces and rethink its strategy.
You could say the EU is acting like a general after losing a battle - but a general determined to continue the campaign.
But all the leaders were clear that you cannot have the advantages of the EU single market without playing by the rules - including free movement of people.
Brexit is a huge crisis for the EU. German Chancellor Angela Merkel said "we have no illusions - it's a qualitatively different task" compared with previous crises.
They are all worried about contagion from the UK's economic instability.
Italy's Prime Minister Matteo Renzi left the summit with a sting in the tail, saying: "The Brits have made a choice. We are sorry, but at the end of the day they will be worse off - not Europe."
German Chancellor Angela Merkel also reiterated that there would be no discussions with the UK until Article 50 was formally triggered by the UK government.
"We wish that that would happen as soon as possible," she said.
Meanwhile Scotland's First Minister, Nicola Sturgeon, has held talks with EU officials in Brussels, including Mr Juncker, after Scottish voters opted to remain in the EU.
She said she had had a "sympathetic response" from EU leaders, and if there was a way for Scotland to stay in the EU she was "determined to find it".
Mr Juncker earlier said Scotland had won the right to be heard, but that the EU did not want to interfere in the UK's internal affairs.
The French president and Spanish prime minister have both said they are opposed to the EU negotiating potential membership for Scotland.
At Westminster political uncertainty continues as the Opposition Leader, Jeremy Corbyn, seems certain to face a leadership challenge. Mr Cameron told Mr Corbyn to stand down in the national interest.
Nominations for a new Conservative leader to replace Mr Cameron have opened.