Cajamarca, Peru - First, the the young man is forced to do 30 push-ups while being whipped on his back. When he finally gets up, exhausted, he is asked again to confess.

Neighbours say the night before they saw him climb over the fence of the construction site where he works. A hammer, a water pump, and a wrench were missing, and he hadn't shown up for work the next day. For the rondas urbanas - urban patrols - the case is clear: the young man is guilty.

Another 100 squats follow, after which Justo Vargas Sanchez, the president of the rondas urbanas in Cajamarca, again asks the young man of about 19 for a confession.

But this time he warns him: if he doesn't confess, they will take him up the hill, remove his clothes, and leave him there for the night. At 3,000 metres, it is cold. Still, he denies that he stole anything.

"You don't have proof," he says, on the verge of tears. "You hurt people without proof."

The rondas are vigilante groups operating in Andean cities and villages.Their methods have been controversial: some say they constitute torture and are, therefore, a breach of human rights (PDF).

'The law runs through our veins'

The rondas use their own judicial system, which they believe dates back to pre-Colombian times when the Incas still had their kingdom in the Andes.

The system aims to amend social ties through the acknowledgement of guilt and an appeal for forgiveness.

When they catch a suspect, they have them appear before an improvised court, where the victim of the crime pleads their case and presents proof (PDF).

The rondas vote on whether or not they believe the person to be guilty, and decide on what they consider to be a suitable punishment. It all happens very fast - the rondas believe the official legal system in Peru is too slow and corrupt, leaving criminals unpunished.

For the beatings, they use a whip made out of the twisted leather of a bull's penis. It is like a stick, and some beatings have been severe. There have even been cases where victims of the rondas' justice have 'disappeared'.

"Incidents have happened, of course," says Marcos Diaz, the national president of the rondas. He lives in the city of Bagua Grande, some 400km from Cajamarca.

"No system is perfect. But these incidents are isolated cases, and at the end of the day, the rondas have done way more good than bad. There have been issues with power abuse, but we solved these - in our own way," says Diaz.

Law school is not a prerequisite to work with the rondas. "The law runs through our veins, as a genetic heritage from the Incas. The state believes they own the law, but that's still colonial thinking. The Peruvian law, which comes from the Spaniards, protects the rich, because they can pay for good lawyers and buy off judges. The poor are only strong when they stand together," Diaz explains.

He has been imprisoned for kidnapping, which is often the way the state prosecutes the rondas for their actions, and says the experience taught him that prisons are like universities for criminals. It's where they learn their trade and build their networks.

That's why the rondas prefer corporal punishment, after which they say they help the criminal and their family to straighten out their lives. Diaz says some of those they have punished have gone on to become part of his group of rondas.

Justice for the poor

On the streets of Andean towns, many people express gratitude for the rondas. People like Danis Tasilla Caja, who lives with his family in the suburbs of Cajamarca, and says he is happy with this form of justice. Four years ago, taxis wouldn't risk going into his neighbourhood after dark. It was considered too dangerous and the drivers feared being robbed of their day's takings or killed for their car.

But Tasilla says all this has changed since the rondas urbanas started patrolling the area. Carrying their leather whips, they walk around the dirt streets at night.

"It's great," says Tasilla. "I don't have to worry any more about my daughter coming home late from her job."

"We have closed down many nightclubs and bars where criminality was rampant," adds Vargaz. "By simply entering and setting fire to them, we destroyed these malicious enterprises. They were full of prostitutes and drug addicts."

READ MORE: Legalising 'vigilantes'

One such incident almost cost him his life. One night, he says, he came home to discover that three men were waiting for him. When they started shooting, he hid behind a pay phone. He later learned that the men were from the coast, brought in by one of the nightclub owners whose business he had helped shut down because there were three under-age girls working as prostitutes there.

The rondas also deal with other types of disputes - offering a judiciary system for the poor, who can't pay for notaries or lawyers and feel the police do not represent them. People approach them with issues ranging from divorce to land feuds with neighbours.

Working with the police

In Cajamarca, the police have been working with the rondas for a year-and-a-half, which doesn't happen elsewhere in Peru. While Vargaz and his group are out on patrol, they can call the police for back-up.

According to Police Chief Gustavo F Sanchez Padilla, this is a way of keeping an eye on the rondas to make sure that they don't abuse people.

Sanchez says the police cannot agree with their methods. But as the beatings happen in obscure places and the victims almost never file complaints, there isn't much the police can do about it, he says. All they can do is encourage the rondas to bring the suspects they catch directly to the police station before delivering their own 'justice'.

The claim that the rondas urbanas have changed the lawless neighbourhoods of Peru makes Sanchez smile. "Crime levels always go up and down," he says. "That has nothing to do with them."

Political power

Jose Rodriguez Villa, a professor of anthropology in Cajamarca, has studied the rondas for decades.

He's researching whether the methods employed by the rondas were actually in use at the time of the Incas. Peruvian law allows indigenous people to use their own traditional systems. But if, for instance, Rodriguez one day proves that the whip wasn't used during the Inca period, it would be easier to prohibit the rondas from using it.

Rodriguez explains that the rondas campesinas - farmer patrols - first became powerful when the government of former dictator Alberto Fujimori used them as a weapon against the Shining Path guerrilla uprising in the 1990s. Fujimori was afraid the guerrillas would take control of the rural areas.

The rondas then started to patrol city neighbourhoods, as rondas urbanas. In the past few years, they have printed their own law book, which states that the "Rondas do not torture or kill".

More recently, the rondas have become more deeply involved in political issues. In 2011, they successfully staged a protest against the Conga gold and copper mine in Cajamarca after a mercury spill. The opening of the mine has been postponed indefinitely.

According to the president of the rondas, this is part of the new role the rondas want to play in Peruvian society: fewer whippings, more politics. They do not want to form a conventional political party, Diaz says, but want to use their own system - using rondas, for example, to investigate corrupt judges.

READ MORE: Mexico forces face-off with vigilantes

Whether because of the rondas or not, the streets in Cajamarca are now safer at night, in contrast to coastal cities such as Trujillo or the capital Lima. Peru struggles with organised crime connected to the trafficking of cocaine, and children from poor neighbourhoods are sometimes used as assassins, killing for $100 or less.

Both presidential candidates in this year's elections presented fighting crime as a main priority in their campaigns.

The young man being beaten at the construction site is eventually released. Halfway through the interrogations, the rondas begin to suspect that he has a mental health problem, because he has a strange smile constantly on his lips. Finally, they contact his family, who promise to pay for any damages.

"It's better if we don't punish him any more," Vargaz says. "If he really is mentally ill, we could end up in jail."