Rafaela Silva’s journey to Olympic gold started in the slums of Cidade de deus, a violence-plagued favela in Rio de Janeiro that she called home as a child.

On Monday afternoon, Silva won the biggest match of her life on home soil by defeating Mongalia’s Dorjsürengiin Sumiya in the 57-kilogram division in women’s judo to claim Brazil’s first gold medal at the Rio Olympics.

It was the ultimate accomplishment in a career that has taken several detours, including a brief period where it appeared Silva might quit the sport.

Silva, 24, grew up in the favela, nicknamed the “City of God,” where she could not completely avoid the pull of one of Rio’s most notorious and crime-ridden areas. Her past was profiled in a recent Sports Illustrated article.

Silva “spent the first eight years of her life in the City of God, getting into fights with boys and getting expelled from school,” SI’s Alexander Wolff wrote. “But she showed an early aptitude for street soccer and for pipa combate, a kind of aerial martial art in which combatants fly kites from rooftops and try to cut one another’s strings.”

At age 5, her parents guided her toward judo, partially to give Silva and her sister structure.

“Judo has rules,” her sister Raquel Silva told The New York Times earlier this year. “The street doesn’t.”

Silva’s path to stardom reached a tipping point at the 2012 London Olympics after she was disqualified for an illegal hold during the preliminary round.

What happened next was far worse. Social media users attacked Silva with racial epithets, a type of abuse that Brazilian police say is becoming more common, especially with high-profile black women, according to CBC.

“I was very sad because I had lost the fight,” Silva told CBC recently of her 2012 bout. “So I walked to my room, I found all those insults on social media, they were criticizing me, calling me monkey, so I got really, really upset. I thought about leaving judo.”

Silva’s coach, Geraldo Bernardes, was also concerned that his star pupil would quit. Silva withdrew from those around her and lost focus in her sport. Eventually her family began to worry.

“Rafaela got depressed,” Raquel Silva told The New York Times. “She watched television all day and cried alone in front of the TV. Our mother cooked her favorite things to cheer her up, but that didn’t work.”

Silva took a few months off, but she soon resumed training and went on to become the 2013 world champion.

Her resilience has paid off. Silva’s Olympic memories from London are in the past. The 24-year-old, instead, will now be recognized for the latest medal in her collection — Olympic gold.