A B.C. judge has granted the provincial government an injunction to shut down the long-running tent city on the lawn of Victoria's courthouse due to unsafe conditions.

The decision follows an unsuccessful attempt to shut down the camp, which is at least in part a protest action for more affordable housing.

"I have come to the conclusion that the encampment is unsafe for those living there and for the neighbouring residents and businesses and cannot be permitted to continue," Chief Justice Christopher E. Hinkson wrote in his decision.

"That said, I accept that I must still address the balance of convenience. To accommodate that balance, the residents of the encampment must leave the encampment as soon as the housing being made available by the province is available."

In his judgment, Hinkson gives residents without adequate housing who want transitional housing three days to register with authorities and identify which possessions at the camp are theirs. The rest may be "removed" by authorities.

Current residents are also being ordered to register to prevent new people from moving into the camp.

The campers have been given until Aug. 8 to remove their belongings and structures and vacate the encampment.

Litany of health and safety concerns in ruling

The injunction hearings were held June 27 and 28 in Victoria and followed an order for the destruction of the camp in June from B.C.'s fire commissioner over growing fire safety concerns.

That order was rescinded early in July when compliance with earlier orders improved, but in his ruling, Hinkson noted fire safety remained an issue both for the camp and its neighbours.

Other health and safety concerns cited by Hinkson included aggressive dogs, hoarding, rats, used needles and condoms and public urination and defecation.

Hinkson also noted the increasing costs of the camp both to the City of Victoria and the province, the negative reported impacts on the neighbourhood and how leadership at the camp had become "less effective."

He found crime at the camp was increasing, with stolen items being found there. He also noted the presence of an "organized and criminal street gang" involved in drug trafficking.