KABUL, Afghanistan — As the fate of Helmand Province hung in the balance last month during a withering Taliban offensive, the province’s deputy governor, Mohammad Jan Rasoolyar, found his urgent pleas for help from the central government going unheeded. So he did what millions of other people do every day: He ranted on Facebook.

Mr. Rasoolyar posted an open letter to President Ashraf Ghani’s government on the social media site, in which he deplored the precarious state of the military and police forces in Sangin District, who were short of food and ammunition and encircled by Taliban fighters. Without immediate aid, he said, Sangin, as well as the provincial capital and perhaps the entire province, would probably fall.

In one sense, Mr. Rasoolyar’s plea worked: His Facebook post drew wide attention from the news media, adding pressure on the government to speed up reinforcements to Helmand. The Taliban offensive has been slowed by the Afghan security forces with help from American Special Operations forces and airstrikes.

In another sense, successful social media activism can look a lot like insubordination: The government fired Mr. Rasoolyar for his trouble.