KABUL, Afghanistan — The United States has sent military advisers to aid Afghan forces in Ghazni, where they were struggling Sunday to regain full control three days after the Taliban launched a massive assault on the eastern city.

The assault was a major show of force by the Taliban, who had infiltrated deep into the city and attacked from several directions. In recent years, the insurgents have seized several districts across the country and staged near-daily attacks on Afghan security forces, but have been unable to capture and hold urban areas.

The U.S.-led NATO mission has carried out airstrikes in support of Afghan forces. Lt. Col. Martin O’Donnell, a spokesman for U.S. forces in Afghanistan, said Afghan forces were engaged in a “cleanup operation,” while acknowledging for the first time that “some U.S. advisers were on the ground.”

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

The insurgents have meanwhile been steadily increasing their political profile, demanding direct talks with Washington and recently meeting with officials in neighboring Uzbekistan.

The assault on Ghazni began as the head of the Talban’s political office was wrapping up the rare diplomatic foray in Uzbekistan

Ghazni, a key city linking areas of Taliban influence barely 75 miles from the capital, Kabul, came under attack early Friday. The Taliban claim to have seized parts of the city, while Afghan officials insist the situation is under control.

The Taliban have destroyed a communications tower, severing phone links and making it difficult to confirm details of the fighting.

Afghanistan’s Tolo News reported that a reinforcement convoy of Afghan forces was ambushed Sunday as it made its way from neighboring Paktia province to Ghazni. They were hunkered down about 50 miles from Ghazni, it said.

.