KABUL, Afghanistan — The test facing the Afghan government now is not just whether it can quickly mount a counterattack and retake all of Kunduz, the northern city that fell to the Taliban on Monday, but whether it can prevent a nearby provincial capital from falling as well.

Accounts from the neighboring province of Baghlan on Wednesday showed that the collapse of government forces in Kunduz against less numerous Taliban forces was prompting a crisis of confidence in the province, where wealthier citizens and those with government connections have been leaving for the relative safety of their hometowns.

In the midst of one of the gravest moments for the American-backed government in Kabul, military leaders spoke Wednesday about launching a decisive counterattack against the Taliban in Kunduz. But it was becoming clear that most of the reinforcements for such an attack had been waylaid in Baghlan.

The reinforcements “will not be able to reach Kunduz without a big fight,” said Ted Callahan, a Western security adviser based in northeastern Afghanistan.

But early Thursday, reports from the area suggested that the promised counteroffensive might be underway. Afghan officials, speaking to the BBC and Reuters, said the Afghan military had retaken some areas of the city.

Sayed Sarwar Hussaini, a spokesman for the Kunduz police chief, told BBC Afghan that the military had regained control of the governor’s office, the police chief’s office and the building housing the intelligence agency.

It was unclear which Afghan forces were involved in the counteroffensive, and details of the fighting were not immediately available.

The Taliban have proved in the last few days just how tight a grip they hold on a part of northern Baghlan that abuts Kunduz Province. Reinforcements from either Kabul or the government stronghold in Mazar-i-Sharif must pass through the area to reach Kunduz City, and some convoys have been ambushed there.

It was not clear on Wednesday whether the front line in the north was still in Kunduz or was rapidly shifting south into Baghlan. That, at least, was how residents of Baghlan’s provincial capital, Pul-i-Kumri, were feeling.

“It is true, people are evacuating the city today,” Zabihullah Rustami, a former member of the provincial council, said by phone. He had done so himself, he said, moving to his rural district to the east. “People who are enemies of the Taliban are leaving,” he said, and the city was rife with “rumors that the Taliban might attack and take over the city.”

Pul-i-Kumri, about 90 miles north of Kabul, could become the next flash point if the Taliban’s momentum in the north is not checked in the next few days.

Taliban fighters have been creeping up to the city’s outskirts over the last six months. Gun and mortar fire are often heard, and skirmishes have become regular occurrences on near the city.

“In Pul-i-Kumri, the situation is not in the favor of the government,” Mr. Rustami said. “If any Taliban come out and shout ‘Allahu akbar,’ the city will fall. The Taliban are close to the city.”

In a worrisome sign, two units of the Afghan Local Police surrendered their bases just outside Pul-i-Kumri to the Taliban on Wednesday and joined the insurgents, while a third base there was overrun, said Mohammad Leqaa, a former general who commanded police forces in several provinces. Other military units in the area were also said to have fled.

Mr. Leqaa estimated that as much as 10 percent of the city’s population left on Wednesday alone. “The residents were influenced by waves of people fleeing Kunduz by way of Baghlan,” he said. “We tried to announce to people not to panic and don’t leave. They weren’t listening.”

Video

Residents Flee Fighting in Kunduz

Residents of Kunduz in northern Afghanistan fled Wednesday after the Taliban took over the city on Monday. Afghan security forces are trying to regain control.

By REUTERS on Publish Date September 30, 2015.
Photo by Ajmal Omari/European Pressphoto Agency.
Watch in Times Video »

Mr. Callahan, the security adviser, said he expected government forces to put up more of a fight in Pul-i-Kumri than they did in Kunduz.

“I think you’ll see much more resistance” from the police and pro-government militias, Mr. Callahan said. “Mind you, Baghlan is big, and most of the security forces are drawn from the eastern parts of the province, so there is a big pool of potential reinforcements.”

Even so, he said, a strong defense could not be taken for granted because if panic took root in Pul-i-Kumri, a Taliban victory could be “a self-fulfilling prophecy,” and a small Taliban force could sow enough fear “to more or less walk in” as security forces retreated.

You are already subscribed to this email.

The Taliban’s resurgence in Baghlan over the past two years is a complicated story of ethnic rivalry and local politics as much as ideology. Baghlan’s sprawling and populous northern district, known as Baghlani Jadid, is largely Pashtun, Afghanistan’s largest ethnic group — from which Taliban members are traditionally drawn.

Pashtuns live in settlements across the north, but they are outnumbered in the region by Afghanistan’s second-largest group, the Tajiks. In Baghlan, many Pashtuns have felt left out of the provincial power structure, especially after a leading Pashtun candidate failed to win the provincial council chairmanship in last year’s election. Since then, Pashtun support for the government appears to have waned in northern Baghlan and insecurity has been rising, especially along the stretch of national highway running through the province.

On Tuesday and Wednesday, convoys of reinforcements headed toward Kunduz were fighting pitched battles with the Taliban in two areas, said Abdul Shaker Urfani, a member of a community council in northern Baghlan.

By his count, more than 1,000 Afghan soldiers and police officers bound for Kunduz were stuck in the province on Wednesday. “They can’t break through the Taliban resistance,” Mr. Urfani said.

The capture of Kunduz, a city of 300,000 people, three days ago appeared to be the Taliban’s largest victory in a war that has gone on for more than a decade. Kunduz is the first urban center the Taliban have held since 2001.

Photo

Afghan soldiers at the Kunduz airport prepared on Wednesday for a counteroffensive to try to retake the city from the Taliban.Credit
Nasir Waqif/Agence France-Presse — Getty Images

Soon after the city fell, Afghan military officials spoke of using its airport, five miles to the south, as a staging ground for a swift counterattack. Now, though, the airport is imperiled as well, caught between Taliban forces approaching from Kunduz and the insurgent-controlled countryside in every other direction.

By Tuesday night, Taliban fighters had pushed through the airport perimeter, threatening several hundred soldiers and at least as many civilians who had fled to the airport from the city. One police officer was killed and at least 17 were wounded defending the area, officials said.

Their situation improved somewhat when American jets struck Taliban positions at 11:30 p.m. and at 1 a.m., an American spokesman said. The Afghan Air Force also fired weapons.

Around the same time, American Special Forces soldiers and Afghan commandos left the airport headed for Kunduz, according to Afghan government officials. Whether the Americans were there to take Taliban positions or to call in airstrikes was not known. By morning, the Americans appeared to have returned, said people there who spoke by telephone. An American military spokesman refused to discuss the matter.

It appeared that at least one American operation in the city ended in failure. An Afghan security official, speaking on the condition of anonymity, said that a group of 100 or more Afghan soldiers, trapped in a fortress north of the city, had held the Taliban off for more than two days. But when American forces tried to airdrop arms and ammunition to them, the official said, “they missed the base and dropped the weapons in the river.” It was not clear whether the weapons actually landed in the water of the nearby Kalagaw River or had merely missed the defenders’ position by a long distance.

That position fell Wednesday morning, and about 60 soldiers surrendered or were captured by the Taliban, although at least a few dozen managed to escape, the official said.

Questions about how thousands of army, police and militia defenders could continue to fare so poorly against a Taliban force that most local and military officials put only in the hundreds were hanging over President Ashraf Ghani’s government and its American allies.

The government forces and militiamen defending Kunduz Province were said to number more than 7,000 when the city fell. Some fell back to the airport, some fled to their homes, and some are unaccounted for.

A version of this article appears in print on October 1, 2015, on Page A13 of the New York edition with the headline: Shaken by Fall of Kunduz, Afghans Now Fear for Neighboring City. Order Reprints|Today's Paper|Subscribe