KANDAHAR, Afghanistan — It was a particularly bitter fight in the heavily contested district of Gereshk in Helmand Province. The adversaries deployed suicide attackers, roadside explosives and a magnetic bomb stuck to the undercarriage of a commander’s car, amid pitched firefights that went on for several days last week.

When it was over, at least 21 people were dead on both sides — and all were members of the Taliban.

As a result, Gereshk remained one of the few places in the province still mostly under the Afghan government’s control, thanks to a breakaway Taliban faction that has become a de facto ally of the government.

Infighting among the Taliban is nothing new. But Afghan officials have now chosen sides, with a policy that amounts to “If you can’t beat them, at least help their enemies do so.”

In recent months, the government has quietly provided the breakaway faction — popularly known as the Renouncers — with weapons, safe passage and intelligence support in their fight against the mainstream Taliban. The result has been a series of successes in areas where the government has otherwise suffered repeated defeats, particularly in Helmand, a southern province where the mainstream Taliban still control 90 percent of the territory.