After nearly a year of court hearings and rising tension between tent city campers and Victoria residents, a judge has ruled the site is unsafe and must be shut down.

The controversial encampment sprang up on the lawn of the city's provincial courthouse last fall thanks to a legal loophole that prevented the City of Victoria from evicting residents there.

B.C. Chief Justice Christopher Hinkson delivered his written decision Tuesday, a week after the latest temporary injunction hearing launched by the province was heard in court.

“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,” Hinkson wrote. “The residents of the Encampment can no longer remain where they are pending the trial of the plaintiffs’ action against them, and the Encampment must be closed.”

But he also said proper time must be given to campers, who won’t be forced out until housing pledged by the province is made available to them.

Hinkson also ordered that in the next three days, campers who do not currently have access to housing must identify themselves to the B.C. Ministry of Housing so they can be provided a space in one of the city’s shelters.

An estimated 80 campers will have to leave the site by Aug. 8 at the latest.

“As housing becomes available, and by not later than August 8, 2016, the defendants shall remove all structures, tents, shelters, objects and things owned, constructed, maintained, placed or occupied by them which are located at the Encampment, and otherwise cease to occupy or reside at the Encampment,” he said.

Hinkson cited a list of health and safety reasons for making the decision, including an increase in violent and criminal activities at the camp since March.

“There has been a significant and continual increase in calls for service directly related to the Encampment in the past year particularly since March 2016 when calls have doubled to the end of June 17, 2016,” he said.

Victoria Police called Hinkson's decision "an important step toward resolving this challenging situation," and said the department would determine its next steps in the following days.

Neighbour Don Allen, who manages a rental property beside tent city, expressed his relief at hearing the news.

"It was hell. We were always on guard, everybody was always on guard and scared to go out at night or work in the early morning hours," he said. "It's finally over."

Others, including Together Against Poverty Society spokesman Stephen Portman, said the decision wasn't necessarily a defeat in the eyes of tent city advocates.

"The chief justice's decision in many respects I think reaffirms what the residents of this tent city have been calling for since the day a single tent was put on that lawn," Portman said. "That the only way to address homelessness is to actually provide housing."

In a statement, B.C. Minister Responsible for Housing Rich Coleman said the decision would help house the remaining campers at the site as well as restore safety to the surrounding community.

"I think the order and the judgment by the courts really did recognize that we, as the plaintiffs, have done a very good job of providing housing for those people who have lived there and been there before," he said. 

Hinkson had rejected the government's original injunction request in March.

Coleman recently announced the purchase of a former seniors care home in Victoria that he would convert into 140 additional units of housing.

He has said that there are now spaces available for any tent city camper who wants to move.

A permanent injunction request launched by the province was scheduled to be heard in September, but tent city lawyer Catherine Boies Parker said it would likely be dropped because of Tuesday's decision.