The battle for political control in Chilapa and elsewhere in the state has become more vicious amid a plunge in the price of the opium poppy, which has forced gangs to diversify their criminal activities beyond drug trafficking, officials said.

The criminals’ campaign to co-opt local politics in and around Chilapa was at first a quiet, somewhat hidden phenomenon, Mr. Rendón recalled. Now, however, it has become “more open, shameless,” he said, with gang members even dictating how entire communities should vote.

Gang members backing a specific candidate have imposed caps on how many votes opposing candidates are permitted to win, giving the appearance of democracy to the final tallies but safeguarding their candidate’s victory.

Erit Montúfar, the brother of Abel Montúfar, said he had urged the candidate to renounce his bid for state Congress in Guerrero before he was killed in May. Their family was deeply involved in politics in the region, known as Tierra Caliente.

When the father of four started receiving threats, his relatives grew concerned.

“At some point, I suggested for him to step down considering all the great risks,” his brother said. “But he refused, arguing he wasn’t doing anything wrong and that he had the right to participate in the election.”

“It was a terrible tragedy,” he said, “not only for our family but for all political parties.”

Mr. Rendón, the local candidate in Chilapa for federal Congress, said the decision to run in spite of threats can be a bold act of conviction — at the risk that it may be your last.

“Yes, we are afraid,” he said. “But sometimes it is the courage to do something for this country that moves you. Sometimes the heart moves you more than fear.”