TORONTO — Canada announced plans Friday to resettle Afghans who aided the Canadian military and the country’s embassy and could face danger because of their work, as the U.S. military withdrawal from Afghanistan nears completion and the Taliban mounts offensives to regain territory.

Canada’s “path to protection” will be open to Afghans with a “significant and enduring relationship” with the Canadian government, although officials did not elaborate on how that would be defined. Those eligible, they said, could include interpreters, locally engaged embassy staff members, as well as a host of other locals who assisted the war effort such as cooks, drivers, cleaners, security guards and their families.

The program will include “special immigration measures that will offer a path to protection in Canada for those at risk due to their work,” the statement said.

“Lives hang in the balance here,” Canadian Immigration Minister Marco Mendicino told reporters, “which is why we are taking timely and decisive action. Canada will do right by those who did right by us.”

Mendicino said the government appreciates “that there is a need to act quickly and decisively, but that we must also do so safely given the very dynamic and rapidly deteriorating situation in Afghanistan.”

The announcement followed weeks of pressure on Ottawa from lawmakers and advocates to resettle Afghan interpreters and other locals. Some veterans said they were so frustrated by the lack of a government plan that they were using their own money to relocate former Afghan colleagues to safer parts of Afghanistan.

The governments of other NATO allies who fought alongside U.S. forces have also faced calls to do more to aid Afghan interpreters or to expedite their resettlement. In Australia, a retired army general burned his service medals in protest of what he said was a lack of government action.

The United States said it plans to temporarily house thousands of Afghans, including interpreters, in Fort Lee, Va. Many Afghans have said their applications for special immigrant visas have been denied despite years of service for the U.S. military and civilian agencies, often without explanation.

Canada joined the U.S.-led mission in Afghanistan in 2001 with many troops initially based in the provincial capital of Kandahar. Its combat role ended in 2011 when the country shifted its focus to training the Afghan army. Canadian soldiers left in 2014. In total, 165 Canadians, including seven civilians, were killed in the war.

In 2009, the government of then-Prime Minister Stephen Harper announced a program to resettle Afghan interpreters — or “terps,” as they were known locally — facing “extraordinary personal risk” because of their work for Canadian forces. Roughly 800 Afghans were resettled under that program, which ended in 2011.

Advocates had long criticized that program as too restrictive. Successful applicants were required to have worked for Canadian forces for 12 consecutive months between October 2007 and July 2011. That excluded many Afghans who assisted Canada during the first several years of the combat mission or for shorter periods.

Among them was an interpreter working with Canada in 2006 when a Taliban-fired rocket-propelled grenade killed Capt. Nichola Goddard. The interpreter helped remove Goddard, the first Canadian female combat soldier to be killed in battle, out of the turret of her light-armored vehicle to receive first aid.

Andrew Rusk, Goddard’s brother-in-law and the co-founder of Not Left Behind, a group advocating for Canada to resettle Afghan interpreters and other Afghans, said the interpreter was ineligible for the initial program because his service predated 2007.

Advocates have for years been pushing for Canada to help those who were excluded from that program. The Taliban’s aggressive push across Afghanistan as the United States ends its 20-year mission in the country has added new urgency to their efforts.

Retired Maj. Gen. David Fraser, who in 2006 led Canadian and U.S. troops as part of the NATO mission in Afghanistan, was among three retired major generals who wrote an open letter to Canadian officials this month urging them to quickly relocate Afghans who assisted Canada’s war effort. He applauded Friday’s announcement.

“I’m pleased that the government has done the right thing by creating a pathway for those Afghans that worked for us and whose lives right now are in peril,” Fraser said. He added, “The devil is in the details.”

Mendicino said it’s too early to know how many people could be resettled but that he expects the numbers to be “in the several thousands.” Canadian officials said teams are in Afghanistan to assess the security situation and to support the resettlement efforts, but they provided no precise details on when Canada might expect its first arrivals.

“For operational security reasons, the precise timing of this operation is extremely sensitive,” Mendicino said.

Canadian officials said they are also working with allies. The Pentagon did not immediately respond to a request for comment.

Corey Shelson, a retired Canadian army captain who deployed to Afghanistan in 2010 as a combat engineer, said he welcomed news of the program.

He said that while he has not used any of his own money in relocation efforts, he was a “link in a chain” of individuals who recently relocated an Afghan man who assisted Canada during the war and who was “within hours of being captured and killed” to a safer part of Afghanistan along with his family.

Shelson said he had spoken to him about the program moments after the government’s news conference.

“There’s a lot of tears, happy tears, being shed by individuals in Afghanistan who were hoping for this type of announcement,” he said.

He said he hopes they begin to arrive in the country soon.

“Until you’re out of Afghanistan, you’re not safe,” Shelson said.

Read more: