The wildfires burning in the northwestern United States and western Canada triggered air quality warnings across both countries on Wednesday, as smoke spread over a region thousands of people have fled from.

Thousands of firefighters and emergency personnel have been deployed in the region. The growing blazes have raised fears of a repeat of last year, when record wildfires in Canada blanketed cities as far south as Florida with dangerous smoke and haze.

There were 40 active wildfires, none of which were under control, in Oregon and Washington covering more than 870,000 acres, according to the National Interagency Fire Center. Many fires are exhibiting “extreme fire behavior,” the center said.

The authorities in Oregon issued air quality warnings for several counties, saying that the wildfires and strong winds could combine to raise pollutants to unhealthy levels. There were similar warnings in effect in parts of Washington and Idaho, with residents in the affected areas advised to limit their time outdoors.

The Durkee fire in Oregon, near the border with Idaho, is the largest wildfire in the United States, covering almost 240,000 acres as of Wednesday, according to the National Interagency Fire Center.

In Canada, there were 175 active wildfires on Wednesday in the province of Alberta, where thousands of people have been under evacuation orders since last week.

The fires forced the evacuation of Jasper National Park on Monday. On Wednesday evening, a blaze swept into the town of Jasper, setting several buildings on fire. The Fairmont Jasper Lodge, a well-known resort in the town, was on fire, according to CBC Radio, Canada’s national public broadcaster.

The local authorities said most of the remaining firefighters were being evacuated because of safety concerns. In a post on X, the park authorities said that several had stayed behind to protect the town’s wastewater treatment plant, communications infrastructure and facilities for an oil pipeline that passes through the park to the Pacific Coast.

Mike Ellis, Alberta’s minister of public safety and emergency services, said on social media that he had asked the military for help.

The authorities in Calgary, Alberta’s largest city, issued a health advisory saying smoke from the wildfires was expected to cause very poor air quality. The government of British Columbia, the province west of Alberta, also warned of poor air quality.