Taliban militants launched an attack Friday on the Afghan provincial capital of Ghazni. (AFPTV/AFP/Getty Images)

Taliban insurgents held on to parts of the key city of Ghazni for a third day Sunday, putting up scattered resistance as Afghan forces backed by U.S. airstrikes worked to clear them out.

The eastern city was overrun by hundreds of insurgent forces early Friday in the Taliban’s latest attempt to capture an important urban target.

Most communication with the city of 250,000 was cut off, and Taliban fighters were described as attacking key government buildings and taking over homes and shops in various neighborhoods. Insurgent forces were said to have mined and set up checkpoints on the nearby highway, which links Kabul with the southern tribal region that is the Taliban’s home turf.

An army official in Kabul, Sharif Yaftali, told journalists Sunday that “strategic and key areas” of Ghazni are under control of the government but that insurgents had taken cover in populated areas, slowing efforts to drive them out. He said officials hope to restore security and reopen the highway within two days. 

A U.S. military spokesman said Sunday that American aircraft had conducted five airstrikes on Saturday and 10 on Sunday. Lt. Col. Martin O’Donnell said in a statement that Afghan troops had “strongly and swiftly reinforced” the city and “continue to hold their ground and maintain control of all government centers” while clearing operations continued. 

The sustained onslaught by hundreds of Taliban fighters is similar to several previous attacks on major cities, especially a 2015 assault on Kunduz in the north and an attack in May on Farah city in the west. Both were retaken by government forces after heavy fighting, but the near-takeovers by the Taliban gave the insurgent group a psychological boost. 

The Ghazni attack appears to be a well-orchestrated and high-profile challenge to the government and its U.S. supporters. It has come despite recent Afghan and U.S. efforts to promote peace talks and build on a successful three-day cease-fire in mid-June. Officials had hoped for a second truce later this month during the Eid al-Adha holiday, but that seems unlikely.

O’Donnell said, however, that “tactically, operationally and strategically, the Taliban achieved nothing with this failed attack . . . The fact remains that the Taliban are unable to seize terrain” and retreat “once directly and decisively engaged.”

While little firsthand information was available from the city Sunday and most cellphone communication was cut off, social media showed videos of badly burned and damaged buildings. Some videos appeared to show government security forces surrendering with their weapons. 

Officials and residents told news agencies that the insurgents were attacking the police headquarters and other government buildings. One lawmaker said that only the governor’s office, the police headquarters and the intelligence police facility remained in government hands.  

There were no confirmed reports on casualty numbers, but one Afghan TV channel quoted hospital officials as saying that more than 90 members of the security forces and 13 civilians had been killed, as well as an unknown number of Taliban fighters. 

Some residents fled toward Kabul by traversing rural areas. One man, named Abdul Wakil, who reached a police check post outside the capital, told the Reuters news agency that he had seen “burning and fire and dead bodies everywhere in the city.”

Sayed Salahuddin contributed to this report.