Ben Treuhaft, 66, moved into his temporary home on Portobello Beach in Edinburgh last month after he was kicked out by his wife from their home in Morningside. He had initially said he planned to stay forever but later said he would move on if he was asked "politely".
The council had insisted his new home was in breach of its park management rules and following a meeting between Mr Treuhaft and a community safety officer, he has now agreed to pack up again.
A spokeswoman for the City of Edinburgh Council said: "He has not slept in the campsite for a week now and he has compliantly agreed to move on from the site permanently. We have offered Mr Treuhaft homelessness advice."