Afghan government forces recaptured main areas of the northern city of Kunduz from the Taliban in the early hours of Thursday morning, said government officials.

Details of the operation and which areas were under government control were not immediately clear.

"Afghan security forces got control of Kunduz city from Taliban overnight after heavy fighting," said Hamdullah Danishi, acting governor of Kunduz.

Interior Minister spokesman Sediq Sediqqi said on Twitter: "It is retaken and being cleared from terrorists, heavy casualty to the enemy."

The seeming advance came after U.S. airstrikes hit Taliban positions around Kunduz Wednesday night into Thursday. The city was seized by the armed group this week, as Afghan troops massed on the ground Wednesday ahead of what is likely to be a protracted battle to retake the key northern city. NATO special forces have also reached Kunduz, seeking to bolster Afghan forces as heavy fighting raged for a third straight day.

U.S. Army spokesman, Col. Brian Tribus, said that U.S. and NATO coalition advisers were at the scene “in the Kunduz area, advising Afghan security forces.”

The Taliban on Monday blitzed into Kunduz and took the city of 300,000 people — the first major urban area they have captured since the 2001 U.S.-led invasion ousted the Taliban regime.

Kunduz, located 108 miles north of Kabul, has been the scene of Taliban attacks since April, when the fighters launched their annual warm weather offensive with an attempt to take control of the city. The surrounding province, also called Kunduz, is one of the country's most important grain producers, and also has rich mineral resources. The province borders Tajikistan.

About 5,000 Afghan troops massed at Kunduz airport early on Wednesday after fighting there extended late into the night, an Afghan security official said, and Taliban fighters were reportedly driven back with the help of a second U.S. air strike.

The U.S. Army spokesman gave few details, but he confirmed that foreign troops had engaged the Taliban while supporting Afghan forces. “Coalition special forces advisers, while advising and assisting elements of the Afghan Security Forces, encountered an insurgent threat in the vicinity of the Kunduz airport at approximately 1 a.m., 30 September,” Tribus said.

He confirmed special forces fought the insurgents, but added: “This was done out of defense. When they encountered the threat, they defended themselves.”

While the U.S. has officially ended its combat role in Afghanistan, it has kept troops there to train and advise Afghan forces and to hit Taliban targets. Though President Barack Obama's plan was to keep only about 1,000 military personnel in the country by the end of next year, the top U.S. commander in Afghanistan, Army Gen. John F. Campbell, has given the administration several options for gradually reducing that number over the next 15 months — all of which call for keeping a stronger-than-planned troop presence on the ground.

The options are said to be based on Campbell's judgment of what it would take to sustain the Afghan army and minimize the chances of losing more ground gained over more than a decade of costly U.S. combat, The Associated Press reported.

Meanwhile, in Kunduz, residents reported fighters going house to house searching for government workers, instilling fear that those connected to the Afghan government may be targeted. The residents spoke on condition of anonymity fearing for their safety.

Roads in and out of the city were blocked, and the Taliban — believed to have joined forces with other armed groups to boost their numbers — released around 600 prisoners from the Kunduz jail. The fighters also set up checkpoints to ensure no one leaves.

The U.N. special representative in Afghanistan, Nicholas Haysom, said he was concerned about reports “of extrajudicial executions, including of health care workers, abductions, denial of medical care and restrictions on movement out of the city.”

Reports from the region indicated that up to 6,000 civilians have fled the city to escape the fighting, a statement from Haysom's office said.

The spokesman for Afghanistan's Public Health Ministry, Wahidullah Mayar, said on his official Twitter account that 30 people have been killed in the fighting and more than 200 inured. “Around 90 percent of them are civilians,” he tweeted.

The U.N. Assistance Mission in Afghanistan called on all parties in the conflict to “protect civilians from harm and to respect human rights at all times.”

Al Jazeera and wire services