KABUL, Afghanistan — The Taliban on Saturday attacked several provinces in northern Afghanistan, overrunning large parts of one district even as American diplomats expressed optimism that a peace process stalled over the release of prisoners was getting back on track.

The insurgents launched major assaults in three northern province — in Kunduz, whose capital was overrun by the Taliban repeatedly in recent years, as well as in Faryab and Badakhshan. Some of the worst fighting occurred in Badakhshan Province, where the insurgents took control of much of the district of Yamgan and inflicted heavy casualties on Afghan forces in another district, Jurm.

Amanullah Iman, who leads the executive branch of the Yamgan district office, said hundreds of Taliban fighters attacked soon after dawn and captured the district center after three hours of fighting. “There were five outposts in Yamgan district center, and the Taliban captured all of them,” Mr. Iman said. “The security forces escaped to a military base in another part of this district.

The fighting rages despite an appeal for a cease-fire on humanitarian grounds to slow the spread of the coronavirus across the country.