As a wildfire barreled toward a territorial capital in Canada, officials ordered an extraordinary citywide evacuation of thousands of people on Wednesday night.

Firefighters were struggling to contain the blaze, which was about 17 kilometers, or just over 10 miles, outside Yellowknife, the capital of the Northwest Territories, officials said. It was expected to reach the city by the weekend.

“The fire now represents a real threat to the city,” Shane Thompson, the territory’s environment and climate change minister, said at a news conference on Wednesday evening. The clear-out will be phased, with the last evacuees leaving by noon local time on Friday.

Several nearby communities, including one of the Indigenous Dene people, Dettah, were also ordered to evacuate. Officials fear that the highway linking those places to Yellowknife — where about 20,000 people live — could be engulfed by fire as soon as Friday. They also warned residents not to seek refuge on islands in the Great Slave Lake because the air quality in the region was expected to deteriorate significantly as the fire nears.

The remarkable order was yet another reminder of the disruption wrought by Canada’s worst wildfire season on record. About 1,000 fires are active in the country. So far this year, the fires have burned an area 91 times as large as last year’s entire fire season. At times, smoke has traveled as far south as Georgia and as far east as Europe.

On Wednesday, officials urged people to drive south to Alberta, if possible. Escort vehicles had been assigned to guide motorists through some areas because smoke from the fires has sometimes obscured vision along the only southbound highway out of Yellowknife. Officials said extra refueling stations and tow trucks would be placed along the route.

Evacuation flights on commercial airlines and Royal Canadian Air Force planes are scheduled to begin on Thursday. People escaping that way will be limited to a single piece of carry-on luggage; they were encouraged to bring food and drinks, and to limit themselves to five days’ worth of clothes.

Exactly what evacuees will do when they reach safety was unclear. An official notice posted by the territorial government on Wednesday said that no reception centers had been set up for evacuees.