When Rafael Sousa (not his real name) found out his wife had been talking to a male colleague about their relationship, he lost his temper and, after hours of yelling, beat her as she lay on the floor.

He had seen messages on his wife’s phone and confronted her about them one evening. “We had been having problems before but that was the trigger,” Sousa, 29, says. “We argued throughout the night. I had never thought about hurting her before but, just before dawn, I slapped her, yanked on her hair and kicked her.”

Both fled the house; Sousa went to a friend’s home and his wife went to her family. It took a day for Sousa to calm down and realise he had done something wrong. Now, as he recounts that night, he deliberates over each word and is full of remorse. His wife filed for divorce and a restraining order, and pressed charges against him.

Violence against women is a huge problem in Brazil because we have such a ​[male chauvinist] culture. I’m proof of it

Sousa, who is training to be an accountant, grew up and still lives in Serra – the 29th most dangerous municipality in Brazil in terms of the number of murders – in the state of Espírito Santo. Here, violence against women is rampant. From 2005 to 2012, the state had the highest rate of murders of women in the country. In the years since, it has been in the top five. Nationwide, almost a third of girls and women said in a 2017 survey that they had suffered violence – ranging from threats and beatings to attempted murder – during the previous year.

The problem permeates all levels of society, says Gracimeri Gaviorno, chief officer of the civil police in Espírito Santo. She recalls one case where a woman, who was married to a jeweller and lived in a prosperous neighbourhood, was held captive with her two severely malnourished children for 12 years. The woman one day managed to escape to the police. Gaviorno says: “When she arrived, I was shocked by the cigarette marks on her skin and the iron impressions on her legs.” The man was arrested and sentenced to 109 years in prison. He was released on health grounds in 2010, and arrested for the same crime three years later.

Violence against women is ‘a huge challenge’ in Espírito Santo, says Gracimeri Gaviorno. Photograph: Sarah Johnson/The Guardian

This was just one of many cases where aggressors hurt more than one victim. Gaviorno saw many men reoffend while they waited – in some cases for years – for their trial, so she decided to do something about it. “You can’t just wait with your arms folded while the justice system takes its time to do something,” she says. In 2016, she worked with psychologists, social workers and other police departments to develop the Homem que é Homem programme to rehabilitate aggressive men.

The programme is voluntary and offered to all men who come into contact with the police for violence against women. For those who complete it, there is no reduction in sentencing, but it can be presented to the judge as a kind of character witness.

There are seven courses a year, with four 90-minute sessions a week for five weeks. Everyone arrested for violence against women must attend an introductory lecture.

Ana Paula Milani, a police psychologist involved in running the programme, says: “I start off explaining that hitting a woman isn’t normal and is a crime, and that there is a programme to help them. The majority of men don’t know why they are there, and even after my lecture, some still think it was the woman’s fault.” For every course, around 60 men will come to the first lecture; around 20 agree to participate in the programme and 15 complete it.

Group sessions are run like an AA group. Participants sit in a circle and discussions revolve around gender roles in society. They examine the concept of masculinity – machismo is rife in Brazil – and talk about why men are more likely to take drugs and why the male suicide rate is higher. They then discuss how to manage and resolve conflict without resorting to violence. The last meeting is about how to return to having a relationship and how to regain trust.

The programme, run by police professionals, has been successful. In its first year, 6% of attendees reoffended; the number fell to 3% in its second year and in 2017, when 73 men completed the course, 2% reoffended. The project has been replicated in three other areas of the state, and there are plans to launch it in two other municipalities.

Psychologist Ana Paula Milani and Gracimeri Gaviorno outside the police department in Vitória, Espírito Santo. Photograph: Sarah Johnson/The Guardian

Sousa completed the programme. At first he was wary of attending a project run by the police, who he felt were more of a hindrance than a help in Serra. “The common conception is that police just arrest people and take them away. Here, the police were trying to help. I was scared it was going to be a finger-pointing exercise but I felt welcome. I saw examples of men who had gone through similar things. I learned a lot – that the best way to find a solution is by dialogue and conversation – and grew.”

He hasn’t been in another relationship but is on speaking terms with his ex-wife and sees her a couple of times a month. He says: “Violence against women is a huge problem in Brazil, in part because we have such a [male chauvinist] culture. I’m proof of it. I’m not a violent person – I grew up in a violent neighbourhood and was determined not to be the same – but I still committed this crime. Anyone can do it.”

Gaviorno, who was a finalist in the first awards in Brazil to recognise outstanding contributions to the public sector, is aware that the project plays only a small part in tackling violence against women, which she says continues to be “a huge challenge”. “From the female lawyer who asks for something from the judge and gets it because she is pretty, to the woman who is murdered by her husband, there are a lot of layers of sexism in Brazil,” she says. Until this changes, Gaviorno and her colleagues will have their work cut out.

• Award organisers Instituto República paid for flights to Brazil for the reporting of this story