Afghan forces launched a clearing operation Friday, searching for Taliban fighters following a major assault on the southeastern city of Ghazni, after US air strikes targeted insurgents trying to overrun the city.
Ghazni -- less than two hours by road from Kabul -- has been under threat from massing Taliban fighters for months, with residents saying the complex nature of the attacks was unprecedented in its scale.
A spokesman for US Forces in Afghanistan said the fighting had "ceased" as of Friday morning, hours after the insurgents began the assault late Thursday from several positions around the city.
However, sporadic gunfire continued to echo into the afternoon amid intermittent clashes, with officials telling residents to stay in their homes as scattered Taliban fighters roamed the streets.
"Our commandos and Afghan army forces... are conducting a clearance operation as the Taliban have taken up positions in civilian houses," said Mohammad Radmanesh, a defence ministry spokesman, adding that security forces were in control of the city.
Power has been cut to Ghazni since the fighting erupted, with communications in the area appearing to be down.
"We are scared for our lives. The Taliban are roaming everywhere in and around the city," shopkeeper Mohammad Haleem said hours after the assault began.
Another resident, Yasan, said the Taliban had used loudspeakers at the mosque after entering the city to warn residents to stay in their homes.
Bodies in the streets
Civilian houses and army checkpoints came under mortar attack and the bodies of dozens of Taliban fighters were in the streets, provincial governor spokesman Arif Noori said.
The US said that the city remained under government control.
"U.S. Forces responded with close-air support this morning in #Ghazni," the official account for US Forces in Afghanistan tweeted Friday.
"Afghan forces held their ground and maintain control of all govt. centers. Another failed attempt by Taliban to seize terrain, while creating strategically inconsequential headlines," it said.
"Initial reports indicate minimal Afghan security force casualties," the US spokesman later told AFP, adding that American forces deployed attack helicopters and conducted a drone strike in response.
Baz Mohammad Himmat, head of the civilian hospital in Ghazni, said at least 16 people had been killed in the fighting, including 14 soldiers and two residents.
A spokesman for President Ashraf Ghani said the Taliban had suffered heavy casualties in the onslaught and confirmed the airstrikes.
Police special forces have also been deployed to help block the Taliban advance, an Afghan security official said.
The Taliban issued a statement claiming to have captured "most of the government buildings inside the city", and that they killed and wounded 140 security forces.
The insurgents frequently exaggerate their battlefield gains and downplay losses incurred during fighting.
Afghan forces have been struggling to hold back the resurgent militant group since the withdrawal of NATO combat troops at the end of 2014.
In May, the Taliban attacked the western city of Farah. After a day of intense fighting, Afghan commandos and US air strikes drove the group to the outskirts of the city.
The insurgents have also so far ignored an offer by Ghani in February of unconditional peace negotiations.
However, there are tentative signs that diplomatic efforts to bring the insurgents to the table for peace talks may be starting to bear fruit.
The Taliban have long insisted on direct talks with the United States. Washington has repeatedly refused, saying negotiations must be Afghan-led.
But the US indicated a change in its longstanding policy in June when Secretary of State Mike Pompeo said the United States was prepared to "support, facilitate and participate" in talks.
Pompeo also said the role of foreign forces in Afghanistan would be on the table.
Last month, Taliban representatives met US officials for talks in Qatar.
Kabul-based analyst Haroun Mir said Friday's attack may have been aimed at securing maximum leverage before engaging in formal peace talks.
"They want to enter the talks from the position of strength, and they want to capture big cities before potential peace negotiations," said Mir.
An unprecedented truce in June brought fighting between security forces and the Taliban to a temporary halt, giving war-weary Afghans some welcome relief from violence.