Homeless people living in a growing tent city on Nanaimo's waterfront have been told to leave within 21 days after a judge granted the city a temporary injunction request Friday.

Campers have been occupying the space, dubbed "DisconTent City," on Port Drive for four months, and the city has repeatedly tried to oust them citing fire and safety concerns.

The city was finally given the power to remove the roughly 250 to 300 campers and dismantle the tent city following the B.C. Supreme Court Judge's ruling.

"I am further satisfied that Nanaimo has met the test for an interlocutory injunction requiring removal of the Tent City," Justice Ronald Skolrood wrote in his decision. "Given the length of time that the Tent City has been in place, and the precarious circumstances of many of the residents, it is important that the dismantling occur in an 'orderly and sensitive fashion.'"

After the 21-day period is up, Nanaimo city crews are authorized to dispose of all strictures including tents and shelters or other items that remain on the property.

The judge also granted an enforcement clause, meaning Nanaimo RCMP have been authorized to arrest and remove anyone who contravenes the order.

The judge did not, however, rule to prohibit tents or other structures on any city-owned properties, writing "Any such future encampments can only be assessed in light of the circumstances existing at the time."

Legal representatives for the campers argued that it was safer for the homeless population to live together and have a sense of stability in the tent city, including better access to services and safer conditions for drug use.

"However, these factors have also existed in many of the other cases considered above in which the courts have granted injunctions similar to that sought by Nanaimo here," the judge wrote.

Ultimately, the judge sided with the city, saying the tent city could no longer be safely maintained due to fire issues stemming from its growing population.

He also noted the "second key factor" of deteriorating leadership within the camp.

"While it is apparent that efforts were made initially to establish a form of governance structure within the Tent City, the expanding size and changing composition of the Tent City has significantly undermined those efforts," he said. He also agreed with the city that the concentration of people in the tent city led to an increase in crime in the downtown core "that is harming local businesses."

A trial has also been ordered for Nanaimo's application for a permanent injunction.