After fighting off the nighttime assault, police were conducting house-to-house searches and trying to work out how the Taliban infiltrated so deep into the city, which is barely 120km (75 miles) south of the Afghan capital of Kabul.
City hospital administrator Baz Mohammad Hemat said two wounded civilians were brought in for treatment.
Mashal said 12 police had been wounded and there were more than 100 other casualties.
The Taliban also suffered heavy losses, he said.
Taliban fighters stormed a provincial capital in Afghanistan before dawn on Friday, exchanging fire with security forces and reportedly leaving several dead.
"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.
Afghan troops on the ground called in airstrikes to try quash the offensive.
Lt. Col. Martin O'Donnell, a spokesman for US forces in Afghanistan, said that the insurgents had attacked "multiple government centers" in Ghazni, a populous city about 100 miles south of Kabul on a major national highway, but that they were driven back.
Bairstow departs but England lead past 200
But it was new-ball partner Mohammed Shami who made the breakthrough when Keaton Jennings (11) was lbw playing across the line. The all-rounder looked every inch a top-order batsman as, in tough conditions, he took the game to the India attack.
Taliban spokesman Zabihullah Mujahid claimed parts of Ghazni had been seized and scores of people killed. In May, the Taliban briefly overran the western city of Farah, but Ghazni is far more important and the scale of the attack much greater.
The city of about 140,000 people was in lockdown as residents stayed indoors and reported sporadic gunfire.
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.
"Initial reports indicate minimal Afghan security force casualties", the USA spokesman later told AFP, adding that American forces deployed attack helicopters and conducted a drone strike in response.
The Ghazni attack was the second assault on an Afghan city this year.
Afghan forces have been struggling to hold back the resurgent militant group since the withdrawal of North Atlantic Treaty Organisation combat troops at the end of 2014.
The Taliban are fighting the Western-backed government to restore their version of sharia, or Islamic law, after they were driven out by US -led forces in 2001.
Afghanistan told the United States that Islamic State fighters who surrendered last week will be treated as prisoners of war, and not honored guests, despite the warm welcome they had initially received, a top USA general said on Wednesday.
The attack comes as pressure continues on the Taliban to enter peace talks with the Afghan government.