But with Taliban fighters believed to be hiding in residential areas, it was unclear whether the government had full control of the city, with communications badly hit after a number of telecoms installations were destroyed.
"We are scared for our life".
The attack on a city straddling the main highway between the capital Kabul and southern Afghanistan was a show of strength for the Taliban, underscoring how volatile the security situation remains less than three months before parliamentary elections in October. "We are terrified", Yasan wrote in a Facebook post.
At least 39 insurgents were killed, while 14 police died and 20 were wounded in the fighting, said provincial Police Chief Farid Ahmad Mashal.
He said there were many challenges at the moment regarding the issue and that the "Taliban have also some kind of topic that some stakeholders can't accept". "There has not been a single minute of silence for the last eight hours", said a senior government official in Ghazni early in the day. He did not say how many were dead and how many were wounded.
While government security forces in the city of Ghazni repulsed the multipronged attack with the help of US air support, Taliban insurgents remained hunkered down on its outskirts, and some were still holed up in residential areas, according to Interior Ministry deputy spokesman, Nasrat Rahimi.
Lt. Col. Martin O'Donnell, a spokesman for USA forces in Afghanistan, said American forces and US attack helicopters flew in overnight.
Airstrikes called in to quash the offensive also killed dozens of Taliban, Mashal said.
Defense ministry spokesman Mohammad Radmanish said the army helped the police and the city was under control of government forces.
As the US and Taliban explore the next round of direct talks, attacks like the one Friday on Ghazni are a reminder of the pressure faced by Afghanistan's security forces.
The insurgents frequently exaggerate their battlefield gains and downplay losses incurred during fighting. "The whole city is under the control of Afghan forces", Brig.
The Taliban have stepped up attacks across the country since North Atlantic Treaty Organisation and the United States formally ended their combat mission in 2014, and have seized control of several districts.
However there are tentative signs that diplomatic efforts to bring the insurgents to the table for peace talks may be starting to bear fruit.
U.S. forces have launched airstrikes to counter a strategic Taliban assault on a key Afghan city.
The attack followed a similar assault on Farah in May, when fighters came close to overrunning the city in western Afghanistan.
It has so far ignored President Ashraf Ghani's offer of unconditional peace negotiations. Washington has repeatedly refused, saying negotiations must be Afghan-led. "In addition, U.S. aircraft conducted a show of presence", Lt Col. Martin O'Donnell, spokesman for U.S. Forces-Afghanistan, said in an emailed statement.
Secret talks were recently held in Qatar between Taliban and United States officials after an unprecedented three-day ceasefire during Eid celebrations in June that was largely respected by both sides.