Although the Taliban overran a base in northern Afghanistan, and Afghan forces were battling insurgents for a fifth day in the eastern city of Ghazni on Tuesday, the U.S. military reported that the city “remains under Afghan government control.”

“What we observed as these Afghan-led operations drove a large portion of Taliban from the city over the last day or so, was the retreating Taliban attacking the more vulnerable surrounding districts, which Afghan forces are reinforcing,” Lt. Col. Martin L. O’Donnell, a U.S. Forces-Afghanistan spokesman, told Fox News. “That said, some Taliban forces remain in the city. These insurgent forces do not pose a threat to the city’s collapse.”

The U.S. and NATO formally concluded their combat mission in Afghanistan at the end of 2014, but since have come to the aid of Afghan forces as they struggle to combat the resurgent Taliban.

“They never went away,” Marine veteran and author C.J. Chivers said about the Taliban resurgence in Afghanistan on “The Story with Martha MacCallum.” He noted the war had “unrealistic goals.” He said the Afghan security forces weren’t up to standing alone: “The way we trained them often was too hasty, the equipment wasn’t enough and you don’t make a military in a few years” to fight the Taliban.

The Taliban besieged the base, which housed about 140 Afghan troops, for three days before the attack late Monday, said the local provincial council chief, Mohammad Tahir Rahmani.

Rahmani said the base fell to the Taliban after soldiers ran out of ammo, food and water. He said 43 troops were killed and wounded in the attack but did not give a breakdown.

Taliban spokesman Zabihullah Mujahid claimed responsibility for the attack, saying 57 Afghan soldiers had surrendered to the Taliban while 17 others were captured. He said eight military Humvees were seized.

The attack on Ghazni came as a shock, The Washington Post reported, because the Taliban used massive force, which included non-Afghan Islamist fighters, and the assault showed signs of long-term planning.

“The Taliban who have hidden themselves amongst the Afghan populace do pose a threat to the civilian population, who were terrorized and harassed,” O’Donnell said.

The fighting has brought civilian life to a standstill, with most residents sheltering indoors.

The Red Cross said roughly 20 percent of the city’s population depends on the municipal water system, which has been down since the start of the fighting. It said it had organized an effort to truck in water, serving 18,000 people.

“The Taliban, who falsely and repeatedly claim that they do not target civilians, have executed innocents, destroyed homes, burned a market and created the conditions for a potential humanitarian crisis with this attack,” O’Donnell said. “Clearly the Taliban have paid no heed to the calls of the Afghan people for them to reconcile and join the peace process.”

In Ghazni, meanwhile, Afghan forces battled the Taliban on the outskirts five days after the insurgents launched a massive attack on it. Hundreds of people have fled the fighting in the city, which has so far killed about 100 members of the Afghan security forces and at least 20 civilians.

Nasart Rahimi, a deputy spokesman at the Interior Ministry, said security forces were combing Ghazni on Tuesday, searching for any remaining Taliban fighters. Military helicopters were supporting the ground operations, said Abdul Karim Arghandiwal, a military media officer in southeastern Afghanistan.

On Friday, the insurgents overwhelmed defenses and pushed deep into the city, which is just 75 miles from the capital, Kabul. The United States has carried out airstrikes, and sent military advisers to aid Afghan forces in the city of 270,000 people.

U.S. Defense Secretary Jim Mattis said the Taliban’s use of civilian homes as fighting positions is forcing Afghan government forces to move slowly in expelling the insurgents from Ghazni.

Mattis told reporters Tuesday during a visit to Brazil and Argentina that the attacks reveal nothing new about Taliban capabilities. He said those attacks show the Taliban forces remain focused on fighting among civilians.

Fox News’ Jennifer Griffin, Martha MacCallum and The Associated Press contributed to this report.