YELLOWKNIFE, Aug 16 (Reuters) - A huge wildfire in northern Canada is creeping closer to the capital of the Northwest Territories and could reach the outskirts of Yellowknife by the weekend unless rain comes, the territorial government said on Wednesday.

Canada is enduring its worst-ever wildfire season with more than 1,000 active fires burning across the country, including 230 in the Northwest Territories.

Thousands of residents of the sparsely-populated territory have been forced to evacuate from smaller communities and the hamlet of Enterprise near the Alberta border was almost entirely destroyed by a blaze that swept through on Sunday.

Northwest Territories Premier Caroline Cochrane said some Yellowknife residents were preemptively leaving the city but urged people to remain calm and warned that highways could close suddenly because of the fire risk.

"I've never seen so many vehicles leaving town," Cochrane said. "There's all kinds of rumors out there, but be ready and evacuate if necessary. Be calm. Do not panic."

Yellowknife has a population of around 20,000 people and lies 250 miles (400 kilometers) south of the Arctic circle.

NWT Fire said the 163,000 hectare (402,781 acres) wildfire is currently 17 kilometres from Yellowknife and would likely reach Highway 3, the only highway connecting the city to the rest of Canada, on Thursday. Some areas along the highway have already been ordered to evacuate.

"There is risk to the City of Yellowknife. Our team, alongside the City of Yellowknife, are doing everything possible to slow the growth of this fire and protect the community," NWT Fire said.

The Northwest Territories declared a state of emergency late Tuesday and the Canadian military has been mobilized to help tackle the blazes and airlift some residents to safety.

Cochrane spoke to Canadian Prime Minister Justin Trudeau about the wildfire situation on Wednesday afternoon. Trudeau reaffirmed the federal government's ongoing commitment to help the territory, according to a readout of their conversation.

Western Canada is enduring a heat wave that saw 19 daily heat records broken on Tuesday and is fuelling hundreds of out-of-control wildfires.

In the Pacific province of British Columbia around 80 people were forced to shelter in place in a mountain guesthouse after their only way out was cut off by a rapidly expanding blaze.

The stranded people, including lodge guests and campers from nearby campgrounds, sheltered overnight at the Cathedral Lakes Lodge near Keremeos in the south of the province before being brought down the mountain in vehicles on Wednesday afternoon.

Blazes have engulfed parts of nearly all 13 Canadian provinces and territories this year, forcing home evacuations, disrupting oil and gas production and drawing in federal as well as international firefighting resources.