Administrator of Ghazni city's hospital said at least 14 security forces were killed and 20 security personnel were wounded in the attack.
The Taliban attacked an eastern provincial capital early on Friday, leaving dead and wounded before Afghan forces pushed the militants out of the city, officials said.
The attacks began around 2am with intense gun battles raging and fires burning in several shops in Ghazni city.
Taliban militants hiding inside homes in the city's residential areas slipped into the streets attacking Afghan security forces, provincial police chief Farid Ahmad Mashal said.
After repulsing the daring nighttime assault, police were conducting house-to-house searches for stragglers and to discover how the Taliban infiltrated so deep into Ghazni city, barely 120 kilometres south of the Afghan capital of Kabul.
Administrator of the Ghazni city hospital, Baz Mohammad Hemat, said 14 security forces were killed and 20 security personnel were wounded.
So far two civilians were wounded, but Hemat said the city was shut down and ambulances are not being sent out.
Mashal said 12 police had been wounded and there were more than 100 other casualties.
He did not say how many were dead and how many were wounded. Most of the casualties were Taliban, he said.
Several bodies of dead Taliban militants remained on the street after the government pushed back the Taliban from the city, the police chief said.
He said the bodies of 39 Taliban militants were recovered beneath a bridge in the southern edge of the city. Air strikes called in to quash the offensive also killed dozens of Taliban, he said.
Defence Ministry spokesman Mohammad Radmanish said the army helped the police and the city was under control of government forces.
Taliban spokesman Zabihullah Mujahid claimed parts of the city had been seized and scores of people killed.
He said three Taliban had been killed and eight wounded.
Inside Ghazni city, residents were staying indoors making independent verification of the different claims impossible.
All shops in the city were closed due to the fighting. The road from Kabul to Afghanistan's southern provinces was also closed because it runs through Ghazni.
TRT World speaks to Kabul-based journalist Sultan Faizy to discuss the situation.
Attack on military base
Dozens of bodies of Afghan soldiers have been found in a military base that Taliban militants stormed last week in the embattled southern province of Uruzgan, officials said on Thursday.
The attack in Chinartu district last Friday underlined the ferocity of fighting in many areas of Afghanistan even as speculation has increased about a possible ceasefire during a religious holiday this month.
"We have discovered and transported 40 bodies from the area, so far," district governor Faiz Mohammad said, adding that a number of members of the security forces were still missing.
News of the attack only began filtering out over the past two days. Muhammad Radmanish, a spokesman for the ministry of defence, said 27 Afghan soldiers were killed and five wounded.
The base was back under control of security forces, said Radmanish but the attack has caused significant damage and weapons losses.
Amir Muhammad Barekzai, a member of the provincial council, said some soldiers appeared to have been shot after they were captured but it was not possible to obtain independent confirmation.
Mujahid said 46 members of the Afghan security forces were killed in the Uruzgan clashes.
"Afghan soldiers were not killed in Taliban detention centres," he said.
The attack underlines the heavy losses being suffered by security forces as they fight the Taliban.
A US Congressional watchdog, SIGAR, said in a report last year the losses were "shockingly high" but Afghan authorities no longer release overall casualty data.