Afghan security forces patrol a Kandahar-Helmand highway on Sept. 7 as fighting raged in nearby Uruzgan province against a Taliban offensive. (Watan Yar/European Pressphoto Agency)

Taliban fighters waged street-by-street gun battles against Afghan forces­ Thursday in an isolated southern city that was once a militant stronghold, pushing hard toward government offices­ as Afghan helicopter gunships tried to slow the advance, officials said.

The surprise attack on Tarin Kot, the capital of Uruzgan province, came as Taliban forces­ in recent weeks have seized new territory around the country and made aggressive moves on another strategic city, Kabul, where they have staged a series of suicide bombings and other attacks.

In just the past three days in the Afghan capital, the Taliban has exploded two bombs near the Defense Ministry, killing more than 40 people; bombed and stormed the downtown headquarters of the charity CARE International; and set off another bomb in a residential area.

Officials said the militants appeared to be gaining ground against outgunned security forces in Tarin Kot, even as reinforcements were sent from Kandahar and Kabul to help defend the compounds of the governor and police chief. There were reports that some officials had fled to the city airport, and the Taliban claimed it had taken the local prison and freed all inmates, including insurgents.

Uruzgan Gov. Nasir Ahmad Kharoti, reached by phone briefly, said he had not abandoned his office but added that he could not speak longer because of the “situation.” He said that Taliban forces had advanced toward the city “under cover of darkness” and by hiding amid groves of trees but that “we are pushing them back.”

Tarin Kot is far from major population centers in Afghanistan and more than 75 miles from the nearest large city, Kandahar. But it holds symbolic importance as the birthplace of the Taliban founder, the late Mohammad Omar. It is also at the center of Afghanistan’s opium poppy growing region, a key source of revenue for the Taliban.

The sudden insurgent thrust there is one more sign that the Taliban is moving to establish zones of control in numerous scattered regions, both within and beyond its traditional strongholds. Tarin Kot was protected by Dutch and Australian troops for years until a drastic reduction of NATO forces­ in 2014.

Afghan troops were reported to be weakening under the militant onslaught. Some had to abandon their posts for lack of ammunition, said Mohibullah Popal, a tribal chief and former police official there. Inadequate fighting supplies have led to so-called tactical withdrawals by Afghan forces­ in other recent clashes.

Bette Dam, a Dutch journalist who has reported extensively on Afghanistan’s southern regions, said deepening local frustration over corruption and government infighting has weakened public support for the government in Uruzgan. She said some local anti-government gunmen had joined the Taliban offensive there.

“Uruzgan is now in a very problematic situation where the police and the ANA [Afghan national army] are more and more leaving their posts, not defending the government,” she said.

“It is a victory for the Taliban,” she added, “but it is much more a sign of how weak the government of Uruzgan is.”