RIO DE JANEIRO — The attacks have stunned this city. In one, an assailant held a gun to the head of a 30-year-old woman while raping her in front of passengers on a bus as the driver proceeded down a main avenue. In another, a 14-year-old girl from a hillside slum was raped on one of Rio’s most famous stretches of beach.

In yet another case, men abducted and raped a working-class woman in a transit van as it wended through densely populated areas. The police failed to investigate, and a week later the same men raped a 21-year-old American student in the same van, pummeling her face and beating her male companion with a metal bar.

“Unfortunately, it had to happen to her before anyone would help me,” said the Brazilian woman raped in the transit van. “I was like, ‘Could this have been avoided if they had paid attention to my case?’ ”

A recent wave of rapes in Rio — some captured on video cameras — have cast a spotlight on the unresolved contradictions of a nation that is coming of age as a world power. Brazil has a woman as president, a woman as a powerful police commander and a woman as the head of its national oil company — and yet, it was not until an American was raped that the authorities got fully involved and arrested suspects in the case.