The Taliban are flexing their muscle with a series of high-profile attacks in recent weeks, showing they are far from defeated as the U.S. prepares to withdraw most of its forces from Afghanistan at year’s end.

The Taliban have staged at least 12 attacks targeting foreigners in the past three weeks, many of them inside Kabul.

Although the top commander in Afghanistan, Gen. John Campbell, has said any talk of a Taliban resurgence is “absolutely false,” critics who have watched the Islamic State sweep over Iraq after the U.S. withdrawal are looking on nervously.

The Afghanistan attacks come as the U.S. prepares to pull out all but nearly 10,000 troops.

Retired Gen. Jack Keane, a Fox News military analyst, said the current problem in Kabul was avoidable.

“We predicted that we were going to have major problems around Kabul and to the east of Kabul to the Pakistan border with the Haqqani network,” Keane said, referencing the powerful Pakistan-based Taliban affiliate. “The president did not give us the full number of surge forces, and then over General Petraeus' objections, he pulled them out early.”

Aid and charity groups in the region are urging their workers to leave the country over the Christmas holidays. Even the Canadian Embassy issued an advisory to its citizens cautioning all of them to leave immediately.

“If you choose to travel to Afghanistan despite this warning, you are taking a serious risk. … If you are already in Afghanistan, you should leave,” the message said.

On Saturday, a guest house of the California-based charity, Partnership in Academics and Development, was attacked by Taliban gunmen who killed a South African family – a father and his teenage son and daughter.

The family had lived there for 12 years. The Taliban accused them of being Christian missionaries. The mother, a South African doctor who had been working at a Kabul health clinic, has decided to remain in Kabul in defiance of the Taliban's attempt to frighten international aid workers.

It was the third high-profile attack on western-occupied guest houses in the past 10 days. On Sunday, the Kabul police chief resigned.

So far this year, 36 aid workers have been killed and 95 wounded.

South of Kabul in the Helmand Province, it took the Afghan security forces three days to expel Taliban fighters who last Thursday overran Camp Bastion, the former British and American Marine base handed over to Afghan security forces four weeks ago.

The bulk of the U.S. and international forces will depart at the end of December and plan to hand over all combat missions to the Afghans. About 9,800 American forces will stay to “advise and assist” the Afghan Security Forces.

Many believe the attacks on foreigners are strategically timed by the Taliban to coincide with a two-day international aid conference in London and a NATO summit Tuesday in Brussels, where Afghanistan's new president, Ashraf Ghani, urged the international community to stay.

"I pay tribute to more than 3,400 NATO personnel who did the ultimate sacrifice of losing their lives,” he said. “What brings us together is a compelling case of mutual interest."

Pentagon Press Secretary Rear Adm. John Kirby says the recent attacks by the Taliban are not a cause for major concern.

“I think what we're seeing in Afghanistan in the last week or so was to be expected,” Kirby said at a Pentagon briefing Tuesday. “I would not consider what they're doing a resurgence.

“It's not atypical for them, around periods of transition in Afghanistan, whether it's an election, or now, coming up in December, the end of the combat mission, for them to try to scare the local populace and try to terrorize people with sporadic attacks. But those attacks have had no strategic effect and I might add that the Afghan National Security Forces and police reacted bravely and quickly to each one of those attacks.”

Jennifer Griffin currently serves as a national security correspondent for FOX News Channel . She joined FNC in October 1999 as a Jerusalem-based correspondent. You can follow her on Twitter at @JenGriffinFNC.