Updated

Rogeria Cardeal had spent most of the day in a muggy waiting room at the public defenders' office. She wanted to report that a former partner, who had beaten her for years, had violated a restraining order by approaching her and the kids at church.

The response was discouraging.

"It's not like he would've done anything in a public space," a case manager told Cardeal when she was finally called.

"I would barely call that psychological terror," said another.

The meeting turned into a shouting match, and one of the case managers pushed Cardeal out of the office.

"The fear of dying is the only thing that kept me going when I first started" seeking restraining orders, said Cardeal, a 39-year-old mother of three.

On paper, Latin America's largest nation has progressive legislation to protect women from domestic violence. The 2006 Maria da Penha Law, named after a woman left paraplegic when her husband tried to murder her, has received international acclaim from bodies like the United Nations. The measure increased sentences for domestic abusers and created shelters for victims. A femicide law passed three years ago increased sentences when gender is identified as a cause of the killing.

Yet violence against women is rampant and may be getting worse.

Last year, a record 4,539 women were murdered in Brazil, according to the non-profit Brazilian Forum for Public Security. More than 1,100 were registered as femicides under the new law, nearly doubling the previous year's count.

The Brazilian nonprofit Mapa da Violencia, using data from the World Health Organization, reported in 2015 that Brazil had the fifth highest homicide rate for women of the 83 countries surveyed, and shocking cases repeatedly emerge in the news media.

Last week, a surveillance camera captured 61-year-old Elaine Figueiredo being shot by her ex-husband in front of her house.

In July, security cameras showed the husband of Tatiane Spitzner, a 29-year-old lawyer, attacking her in an elevator moments before she died.

In May, Jessyka da Silva Souza, 25, was shot in front of her family by her former partner, a police officer.

"I always had empathy for the women I saw on TV. But when it happens to someone you know, it changes you," said Anna Caroline Viana, Souza's cousin.

Experts who work with survivors of domestic violence say many cases are not reported, in part because Brazil's crisis-stricken government has defunded many programs, poor women of color don't have the same access to health or legal services and ingrained machismo means women often blame themselves.

Jair Bolsonaro, a far-right candidate leading the polls ahead of October's presidential election, has repeatedly insulted women, once telling a colleague in Congress she was so ugly that she "didn't deserve" to be raped.

Until 2009, the penal code disqualified some victims of sexual violence if they were not "honest women." As late as the 1990s, courts could justify attacks on a woman if she allegedly had done something to dishonor a man, say by having an affair.

"Now our legislation is exemplary, but the changes are very recent," said Jacqueline Pitanguy, a sociologist who directs the human rights organization Cepia in Rio de Janeiro. "The patriarchal culture still persists."

Violence disproportionately affects black women. In 2016, homicide rates were 71 percent higher for black women than those of other races, a discrepancy that has been increasing over the years, according to the Brasilia-based Institute of Applied Economic Research.

Cardeal, who is black, decided to tell authorities about years of assaults and death threats after her former partner punched her as she held their toddler, and since 2013 she has been granted several restraining orders from a wing of the court system dedicated to crimes involving violence.

But such orders only last for three months. Each time she applies for a renewal, the actress and theater producer can lose a day of work, waiting for hours in a cramped room at the public defenders' office. Throngs of people elbow each other in the lines as toddlers and elderly people take up the seats.

When Cardeal went to report the restraining order violation, she waited more than four hours to turn in paperwork to then proceed to the domestic violence unit. After the altercation with the case managers, she met with the public defender, who told her she had a case, but that a judge would have to evaluate it, a process that could take months.

A branch of the government's Specialized Center for Women's Services has helped Cardeal navigate the byzantine judicial system. The Rio office gives about 200 women a month psychological and legal guidance, and when social workers fear a victim may be at risk of death, she is transferred to a secret shelter.

"They come to us to survive, to maintain their dignity as women," said Rosangela Pereira, the director of the office. The city's only other government-run center for domestic abuse closed due to budget cuts, forcing some women to travel long distances for assistance.

Despite years of difficulties, Cardeal has been able to move on. She started a fashion and arts project to help young people with self-esteem, is in a healthy relationship and has a lead role in a play about domestic violence, "Inimigos Ocultos," or "Hidden Enemies."

The play invites the audience to walk through a house where the cast enacts abusive relationships.

In the patio, Cardeal plays a woman talking herself into marrying her attacker. In the bedroom, a man manipulates his partner into accepting his cheating. On a bed, a husband rapes his wife doped on medication.

Cardeal said the spectators may come to understand and recognize domestic violence in their own lives.

"It took me my entire life to understand that," Cardeal said. "When I realized I wasn't at fault, everything changed."