However, Afghan soldiers and police retook the area Friday morning, according to the governor of the province.
"The district is under our control," Gov. Marajudin Pathan told the Associated Press.
More than 100 Taliban fighters launched the attack Thursday evening in the Giro district, according to officials, setting fire to buildings and cutting telephone lines.
Friday morning, more than 250 Afghan troops from Ghazni and the nearby province of Paktika recaptured the city. Police and soldiers were searching nearby villages for any remaining Taliban fighters, according to Pathan.
The attack came despite the presence of 47,000 NATO and U.S. troops in Afghanistan -- up from 32,000 at the beginning of 2007. It also underscored the vulnerability of rural and remote areas to coordinated assaults by Taliban fighters, according to the AP.
Violence across Afghanistan has increased in recent weeks, after a winter lull, as Taliban fighters target both Afghan and coalition forces. Roadside bombs have killed more than 20 Afghan troops in a string of attacks over the past week.
Friday morning, a NATO coalition service member was killed during a gun battle with insurgents in the western province of Herat, according to a coalition statement.
And in the eastern Uruzgan province, militants ambushed a police convoy and killed four policemen. Six Taliban fighters also died in the attack.
Also last week, a suicide bomber killed 10 people in the northern Kunduz province, and police said they foiled a bomber in Kabul.
Overall, violence in Afghanistan has increased this year, according to AP statistics. There have been 40 suicide bombings around the country this year, three times more than during the same period in 2006.
And about 320 Afghan civilians and military, and 680 militants, have been killed so far in 2007. That's nearly double the number killed in the first four months of 2006.
Still, NATO officials say that they are optimistic about the chances of their biggest offensive yet, in southern Afghanistan, to counter militants in the opium-producing Helmand province. They also say that the Afghan national army is becoming a more effective fighting force.
"Only the Afghan government can win this battle," New York University Afghanistan expert Barnett Rubin told the AP. "If we fight a colonial war, we lose."