Michelle Carter wins shot put gold on Day 7 of the 2016 Olympic Games at Rio de Janeiro’s Olympic Stadium on August 12. (Quinn Rooney/Getty)

Rio 2016 been filled with #BlackGirlMagic: The 28 million people on average who watched daily in primetime and tens of millions who streamed the games online — to which many analysts chalk up the reduced television audience — saw our screens and Twitter timelines filled with stellar moments of achievement by African American women, offering all Americans the chance to respond with chants of “U-S-A!” to the athletic exploits of black women, and watch our sons, and particularly our daughters, cheer, too.

But these games also underscored ongoing challenges in race, representation and athletics in America. Black women — Michelle Carter, Gabby Douglas, Ibtihaj Muhammad, “the Simones” — were, in many ways, the American heroes of these Olympics. But in a painful reminder of the ways in which that hero status can often be conditional, and fleeting, these women, other athletes of color, and by extension we, were also unjustly cast at times as the goat.

And the measure of their reception is a measure of the uneven progress of black women in terms of the full measure of citizenship we’ve more than earned, but frequently aren’t afforded.

The gold-medal all-around winning women’s gymnastics team: five women — two black, two white, one Latino — were a microcosm of the pluralistic America of Trump-ian nightmares. Michelle Carter bested her NFL-veteran father’s 1984 silver medal in the shot put, becoming the first American woman to take gold in the sport, all while challenging body-image stereotypes.

Simone Manuel captured gold and became the first black woman to medal in swimming. She and teammate Lia Neal made this year’s the first U.S. swim team to boast two black women in a rebuke of America’s often ugly history of segregated swimming pools and beaches: abandoned by white patrons or sprinkled with acid to keep black children out in the 1950s; or simply barring African American entry outright, as the Valley Swim Club did in Northeast Philadelphia in 2011.

Ibtihaj Muhammad, who won individual bronze and team bronze in fencing, became the first American athlete to both compete and medal wearing the hijab of her Muslim faith. She told of having endured ugly abuse over her religion in the lead-up to her appearance in Rio, but evinced a strength and determination to show the world what Muslim women can do and be.

[Biles: ‘My parents are my parents and that’s it’]

But there was an ugly racial dynamic to these Olympics, as Gabby Douglas, the darling of the 2012 London Olympics, found herself overtaken athletically by the global phenomenon that is four-gold-one-bronze-winning Simone Biles. And just as she endured merciless criticism and abuse from social media bullies over her hair four years ago, Douglas again became the focus of collective scrutiny over her appearance, still apparently not sufficiently coiffed for the Twitter hordes. It got worse. Douglas was policed as insufficiently patriotic during the playing of the National Anthem for having the gall to stand respectfully, and at attention, but not with her hand over her heart. Despite being a member of consecutive team golds, she was called out for being, presumably, too glum, and not demonstrating enough support for her teammates.

It took the valiant defense of black comedian Leslie Jones, who weeks before was briefly chased off social media by a barrage of racist abuse sparked by a right-wing provocateur, but who was flown to Rio by NBC to comment on the games, to launch a hashtag calling on people to show #Love4GabbyUSA. It soon gained a torrent of support.

Her trial, though, isn’t anything new.

In 1932, Tidye Pickett and Louise Stokes, stars of the inaugural track and field team at the then Tuskegee Institute, qualified for the Olympics, only to be denied the opportunity to take the field in the 4×100 relay after enduring isolation and humiliation, including at the hands of their teammates. On the train to the games in Los Angeles, famed track and basketball star Mildred “Babe” Didrikson doused Pickett and Stokes with ice water as they slept in the segregated sleeping car. A defiant Didrikson never apologized.

In 1948, Alice Coachman made history as the first black woman to win Olympic gold, in the high jump; a feat that also made her the first black athlete to win a commercial endorsement, from the Coca-Cola Company; though in Georgia, white fans sending her congratulatory flowers and gift certificates had to do so anonymously so as not to transgress the segregationist code.

Serena and Venus Williams had a quieter Olympics than they have in years past, but while they’ve dominated tennis for years and won medal after medal for their country, they’ve faced decades of relentless attacks for their attitudes, hair, athletic physiques — their very selves. At the start of this year’s games, a surely weary Venus had to upbraid a reporter for failing to count biracial teammate Madison Keys among the four black women on the U.S.A. tennis team.

The struggle to compete and win on behalf of a country that at times doesn’t fully accept black women isn’t unique to Team U.S.A. Brazilian judo medalist Rafaela Silva, in a defiant news conference, called out those who in 2012 called her a monkey who belonged in a cage, not at the Olympics, before coming out of the closet.

These black women are by no means the only Olympic heroes—men and women of all backgrounds have, of course, acquitted themselves spectacularly on behalf of their countries. But black women have borne a burden of representation that no male athlete, black or white, has had to endure. At the cross-section of race and gender lies a special set of rules that further constrain black women in public life, and that athletic achievement cannot always overcome. They walk a fine line between wanting to be embraced purely as athletes and at the same time understanding that race and gender go with them at all times. Before her gold-medal swim, Manuel told reporters, “I would like there to be a day when it is not ‘Simone the black swimmer’”; After she won the 100 meter freestyle, and had tearfully mouthed the words to the National Anthem on the medal podium, she allowed herself to acknowledge: “The gold medal wasn’t just for me.”

Manuel used her historic victory to signal her connection to black swimmers like Maritza Correia and Cullen Jones, and to make a statement in support of Black Lives Matter, saying her triumph was important, “especially with what is going on in the world today, some of the issues of police brutality,” adding that her win, “hopefully brings hope and change to some of the issues that are going on. My color just comes with the territory.” With those words, she claimed kinship with a great tradition of black athletes lending their moment of patriotic glory to a worthy critique of their country, whether it was Tommie Smith and John Carlos raising their fists against racism and oppression at the 1968 Mexico City Games or Olympian Muhammad Ali tossing his 1960 Gold medal into the Ohio River in outrage over segregation. Like them, Manuel risked cashing in her hero status for infamy among those Americans for whom the movement for black lives is akin to a racial threat. That she had the presence and courage to do it anyway is a testament to her as an athlete, an individual and an American.

As Olympians, these women have been asked to uncritically represent their country. As black people, they become proxies for the legacy of their forbears, and are judged on an arbitrary social scale that ranks black public figures in sports, politics and daily life, on a scale from “dignified” to inappropriately brash. As women, they’re subject to a constant, unforgiving gaze that has long critiqued the femininity of black women based on body type, complexion, hair and physical proximity to the European ideal.

Try landing “the Biles” with a smile while all that weighs on your shoulders.

When she was interviewed for Essence magazine in 1984, Coachman spoke of the burdens of representing and inspiring fellow African Americans during a time of segregation, while also meeting the challenge of being a woman in sports.

“It was a time when it wasn’t fashionable for women to become athletes,” she said, “and my life was wrapped up in sports. I was good at three things: running, jumping, and fighting.”

The latter skill continues to come in handy.

Correction: An earlier version of this article incorrectly referenced Simone Biles’s medal count.