With their scuffed shoes, baggy trousers and single shot hunting guns, the eight men preparing to patrol their hillside barrio in the southern Mexican town of Tixtla hardly looked like a disciplined military force. But this motley collection of construction workers and shopkeepers claim to have protected their community from Mexico's violent drug cartels in a way the police and military have been unable – or unwilling – to do.

"Since we got organised, the hit men don't dare come in here," said one young member of the group, which had gathered at dusk on the town's basketball court, before heading out on patrol. "Extortions, kidnappings and disappearances are right down."

Over the past year, vigilante groups like this have sprung up in towns and villages across Mexico, especially in the Pacific coast states of Guerrero and Michoacán. They make no pretence to be interrupting drug trafficking itself but they do claim to have restored a degree of tranquillity to daily life.

In a country where the police are commonly felt to commit more crime than they prevent, the militias have won significant popular support, but they have also prompted fears that the appearance of more armed groups can only provoke more violence.

Tensions exploded this weekend when a march by self-defence groups triggered a gun-battle between gunmen and federal forces in the city of Apatzingán, followed by attacks on power stations that left hundreds of thousands without electricity.

Nearly seven years after the government launched a military-led crackdown on the cartels, the weekend's events have caused many to ask if the new government of President Enrique Peña Nieto is presiding over the first rumblings of an undeclared civil war.

"Perhaps the closest antecedent is the civil wars of central America," said an editorial posted on the widely-read news site Sin Embargo.

The weekend's violence began on Saturday when a group of militiamen marched on the city, saying they were responding to calls for support by residents there who want to set up their own self-defence group. Similar groups claim to have forced the brutal Knights Templar cartel out of smaller towns in the region, but Apatzingán, capital of the Tierra Caliente region, has remained largely in the hands of the drug barons.

Troops allowed the marchers into the city after they had disarmed, but when they gathered in the central square, they came under attack from gunmen on the rooftops – including some who were reportedly stationed in the cathedral belltower. A video shows people running for cover as federal police officers appear to return fire at the attackers.

At the end of the day, the marchers withdrew after the army agreed to step up patrols and include observers from the self-defence groups. But the movement's leader, José Mirales, warned reporters that the fight was not over. "We are going to make sure that organised crime is expelled from Apatzingán," he said. "They will try to respond."

That response came just hours later, when, shortly after midnight, nine electricity substations were firebombed in a string of almost simultaneous attacks. More than 400,000 people were left without electricity. At least four petrol stations were also torched.

In a statement, Mexico's interior ministry promised that: "The actions of the criminals will not stop the actions of the government to protect the population."

But while the government claimed order had been restored to Aptazingán, the tension continued into Sunday when a second group of civilians marched on the local army base. The Knights Templar were widely believed to be behind this second march that demanded federal forces withdraw their protection from the self-defence groups. Also on Sunday, five bodies were reportedly found on the outskirts of the city, all wearing t-shirts identifying them as members of the self-defence groups.

The cartel has deep roots within the civilian population of the Tierra Caliente and has proved capable of mobilising its supporters in demonstrations. The cartel has also accused the vigilantes of being fronts for an attempted incursion into the area by a rival crime group, the Jalisco New Generation cartel.

But while the militia near Aptazingán appears to enjoy some support from federal forces, the government has shown far less tolerance of similar groups in the neighbouring state of Guerrero.

This is the case of the group in Tixtla, which lies just outside the Guerrero state capital of Chilpancingo, at the start of the main route into the mountain range of the Sierra Madre del Sur, whose slopes and deep valleys are dotted with secret plantations of marijuana and opium poppies. The area is said to be the hub of a criminal group known as Los Rojos (The Reds), one of the many remnants of the once-mighty Beltrán Leyva cartel, who locals say operate with the complicity of the authorities.

Locals describe how gunmen would hang out at the local petrol station, checking on movements in and out of the barrio; how entire families would be abducted or forced to flee their homes.

"Nobody was doing anything about it so we had to, because we want to be safe and we want to be free," said a young mother, nursing her baby as the militiamen prepared to head out on patrol. "Now the army want to disarm us but if that happens the hitmen will come back."

Relations between the Guerrero´s self-defence groups and the authorities have deteriorated further since the arrest in August of the charismatic female leader of another self-defence group in Olinalá, four hours drive into the mountains from Tixtla.

Nestora Salgado, a returned migrant in her 40s, became one of the symbols of the Guerrero vigilante movement after taking charge of an uprising in October 2012 that began during the funeral for a taxi driver who had been murdered days after a mobile phone vendor.

When the rumour broke out that another driver had been kidnapped, townspeople stormed the local police station and disarmed officers, before setting up barricades to prevent cartel gunmen from returning to the town.

Soon after they started regular community patrols that by the middle of this year were being accused of abusing their newfound power. On 21 August a joint army, navy and state police operation arrested several community police members and put Salgado herself into a high security jail hundreds of miles away, accused of kidnapping.

The swoop on Olinalá triggered marches, road blocks and standoffs around the region that led to more arrests of vigilantes and seized weapons, not always by the authorities.

Hoping to avoid a full-blown crackdown, most of the Guerrero self-defence groups have since retreated into their strongholds and hidden away their higher calibre guns. But there is little evidence that they are about to fade away meekly.

Meanwhile, the military presence has grown, with the truckloads of soldiers trundling along mountain roads and army-run soup kitchens for the poor.

Vidulfo Rosales, a lawyer from the Tlachinollan human rights group based in the area, believes the government is concerned that the self-defence groups will mutate into a guerrilla force, given the area's long rebellious tradition. "The government has this region marked as a place that has the potential to create another insurgency," he said.

Rubén Figueroa, a Guerrero state deputy who heads the local legislature's security commission is one of the few politicians who openly expresses these fears. "I have reliable information that some of these [vigilante] groups have been infiltrated by subversives.

"They are trying to take advantage of the power vacuums that exist in isolated areas."

The vigilantes deny any such links but, whether true or not, they appear to distrust the army almost as much as the cartels. That hardly bodes well for the government's efforts to bring the Guerrero self-defence groups under control.

"The army wanted to detain and disarm us so we have to be careful now, but this is still our territory," said one member of the Tixtla patrol. "If the army ever tries to come in and shoot at us, then we will shoot back."