Up to 80 people have been sleeping rough on land by the Old Civic Theatre since 19 November in a bid to "highlight the plight of the homeless".
Doncaster Council said it had taken action as the site was "unsafe".
Campaigner Paul Hartley said the camp had been a success and "the people it was there to help have been helped".
The protesters have until 10:00 GMT on Saturday to leave.
An application for an injunction banning the protesters from setting up a similar camp in the town was, however, rejected.
Council chief executive Jo Miller said: "I think it's a good outcome.
"We've secured possession of the site and we've made sure that everybody who needs to be housed has been housed so, working together with the organisers, we've achieved the result we needed to.
"I do not think we will need the [injunction]. We are consensually taking the site down because the job has been done by the organisers and the council."
She said of the 80 people on the site "just over half" had been re-housed while "of the other half some of them were not homeless and some did not want any help".
Mr Hartley said the authority had been "amazing" at engaging with those in need of shelter since the makeshift camp was set up.
"They have worked tirelessly with us to get a positive solution to the problem," he said.
"They are tackling homelessness differently now."
Homeless protesters living in a "tent city" in Doncaster are to be evicted after the council was granted a court order.