Afghan forces recaptured most of Kunduz from the Taliban on Thursday, the government said, three days after the militants seized the provincial capital.
Afghan Defense Minister Massoum Stanekzai acknowledged the task had "not been easy" but said his forces were in "full control" of the city on Thursday afternoon.
Interior Minister Noru-Haq Ulomi praised Afghanistan's "brave forces" for retaking the city, telling a press conference that "the enemy has been defeated."
Officials said that search-and-clear operations were ongoing to root out any remaining remaining pockets of resistance.
"It's a horrifying situation here ... Bullets are flying everywhere"
President Ashraf Ghani's office said military leadership had communicated that the situation in Kunduz was "calm" and had returned to normal.
However, residents said that heavy exchanges of fire were ongoing at the beginning of the afternoon in several parts of the city and certain government buildings were still under Taliban control.
Mohammad Daud told NBC News that his neighbor had been shot in the head in the street while heading to the mosque — and that his body was still in the street an hour later. He said he could hear firefights and explosions.
"It is a horrifying situation here," Daud said. "We don't know what is going on exactly ... Bullets are flying everywhere."
The Afghan ministry of defense said in a statement earlier Thursday that 150 enemy forces were killed and more than 90 injured. It claimed there had been no reports of civilian casualties and did not say how many of its own soldiers had been killed or injured.
Local resident Ghulam Shah told NBC News that there had been heavy fighting overnight but when he emerged from his home Thursday morning, he saw government forces taking down Taliban flags.
"They told us to rest assured the city is cleared of Taliban," Shah said. "As I was walking back I saw a large number of Taliban bodies on a a national army truck."
Supported by U.S. airstrikes, Afghan forces have been battling to regain control of Kunduz since Monday. A "limited number of coalition forces" also were on the ground advising Afghan forces, officials said.
Kunduz is a city of about 300,000 about 150 miles north of Kabul. It was one of the last strongholds maintained by the Islamist militant group before being driven from power in a 2001 U.S.-led campaign.