US forces launched airstrikes Friday to counter a major Taliban assault on an Afghan provincial capital, where terrified residents cowered in their homes amid explosions and gunfire as security forces fought to beat the insurgents back.
Officials said Afghan special forces were also being deployed to the southeastern city of Ghazni after the latest attempt by the Taliban to capture an urban centre, with the assault coming as pressure builds on the insurgents to enter peace talks.
Ghazni -- less than two hours by road from Kabul -- has been under threat from massing Taliban fighters for months.
A spokesman for US Forces in Afghanistan said the fighting had "ceased" Friday morning, hours after the insurgents began the assault late Thursday from several positions around the city.
Sporadic gunfire continued to echo, with officials telling residents to stay in their homes as Taliban fighters continued to roam the streets. Power has been cut to the area since fighting erupted.
Earlier, residents described heavy gunfire ringing out and a government building set on fire.
"We are scared for our life. The Taliban are roaming everywhere in and around the city," shopkeeper Mohammad Haleem said.
Another resident, Yasan, said the Taliban were using loudspeakers at the mosque to warn residents to stay in their homes.
"Heavy explosions and gunfire can be heard. We are terrified," Yasan wrote in a Facebook post.
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 continued.
"Initial reports indicate minimal Afghan security force casualties," the US spokesman told AFP, adding that American forces deployed attack helicopters and conducted a drone strike in the response.
At least one Afghan soldier has been killed and seven others wounded in the fighting, provincial governor spokesman Arif Noori said.
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 claiming to have 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 has long insisted on direct talks with the United States. Washington has repeatedly refused, saying negotiations must be Afghan-led.
But Washington indicated a change in its longstanding policy in June when US 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.
Anticipation has also been mounting about the possibility of a government ceasefire announcement for the Islamic holiday of Eid-al Adha later this month.
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.