A High Court judge has ruled that peace protesters camping in Parliament Square must be evicted by 1600 BST on Friday.
Since May, tents and flags have transformed the green into what demonstrators call Democracy Village.
Mayor of London Boris Johnson, who brought the action, said the camp caused "considerable damage" and added that he was "pleased" with the ruling.
But some protesters have vowed to remain in the camp beyond the Friday deadline.
Following the decision two protesters from the camp were arrested for trespass when they tried to force their way into the grounds of Parliament.
The men, who were arrested just before 1800 BST, remain in custody, a Metropolitan Police spokesman said.
'Influx of protesters'
The judge said veteran anti-war campaigner Brian Haw, who has lived at the site since 2001, had been camping lawfully but added that an injunction was necessary as the mayor had not agreed to the occupation.
Mr Justice Griffith Williams said: "As the terms of the injunction make it clear that he can continue to use a tent or similar structure provided he has the permission of the mayor, I would expect the mayor not to enforce the injunction against him until his application for permission has been considered."
But Quentin Cross, one of the protesters from Democracy Village who now faces eviction, said he will stay put.
"I will not be moving now or after Friday voluntarily, and I would say the majority of people here hold that view.
"I don't believe in violent resistance by any means but if you are protesting about government policy then you have a right to be here.
"You might well see an influx in the next couple of days," he added.
Green Party Assembly Member Jenny Jones said the ruling was "at the cost of democracy".
She said: "The lack of police presence showed that the protesters were not causing a problem, yet the mayor was dogmatic in pursuing an expensive legal process."
The judge said that in reaching his decision the mayor "directed himself correctly, considered all the relevant matters and reached a reasoned decision which cannot be criticised".
He ruled there was a pressing social need not to permit an indefinite camped protest on the site to allow others to campaign there.
He noted public health concerns over the site, including the lack of sanitation.
And the judge said there had been vandalism and unlawful behaviour associated with the camp.
The delayed eviction date is to give protesters the time to lodge an appeal against the ruling.
A spokeswoman for Mr Johnson said: "The mayor respects the right to demonstrate - however, the scale and impact of the protest has caused damage to the square and has prevented its peaceful use by other Londoners.
"Parliament Square is a top tourist attraction visited by thousands of people and is broadcast around the world each day.
"We would urge the protesters to respect the court's ruling and now leave the site peacefully."
Protesters had claimed only the Queen had the right to bring such proceedings in relation to the London square.
Mr Johnson had argued he had the right as the Greater London Authority owns the green space.
Colin Barrow, leader of Westminster City Council, said: "We feel that the hijacking of Parliament Square, one of London's historic public spaces, needed to be brought to an end."