A previous version of this story said 97.7 percent of Japan is ethnically Japanese. That number refers to nationality, not ethnicity, which the Japanese government does not track.

TOKYO — Even before she lost in the third round of an Olympic tennis tournament in which she was a favorite to win, Naomi Osaka faced backlash in Japan. The criticism, long running and usually bubbling just under the surface in her birth nation, came to the fore again when she climbed an illuminated staircase to light the Olympic cauldron under the glare of the world’s spotlight.

The issue for many commenters on Yahoo, which serves as a popular forum for a vocal minority of the country’s conservatives as well as a news site, was not that Osaka is too inferior of an athlete to be the face of Team Japan at these Summer Olympics. The 23-year-old is the No. 2 tennis player in the world and a four-time Grand Slam champion.

The problem was that Osaka is “hafu,” or mixed race.

Born in Osaka, Japan, but raised in the United States, Osaka is the daughter of a Japanese mother and a Haitian father, and she expresses her Blackness just as she does her Japanese heritage. She always has represented Japan in tennis tournaments, giving nods as thanks at news conferences and fielding questions in Japanese.

But she is also the woman who chose to wear her usually thick, curly hair in red braids while playing for Team Japan this week. Last summer, she encouraged Japanese people to join Black Lives Matter protests in the wake of George Floyd’s death.

“There have been a lot of comments like: ‘Why is it her? She’s not purely Japanese,’ ” Lawrence Yoshitaka Shimoji, a sociology researcher at Ritsumeikan University in Kyoto, Japan, said in an interview in Japanese. “It’s very sad. And as far as all of these mean, negative comments toward her, nothing is really being done about this; it’s just out there.”

The selection of Osaka to light the cauldron, along with the choice of basketball player Rui Hachimura as one of Japan’s two flag-bearers at Opening Ceremonies, threw into high relief the disparity between the cosmopolitan society Japan wants the world to see and the reality of Japanese attitudes toward anyone who looks or acts differently than a “traditional” Japanese person.

Just 3.4 percent of babies are born in Japan to one parent who isn’t Japanese, and government statistics work to erase any of the country’s diversity by tracking the population solely by nationality rather than ethnicity. It counts anyone who is a citizen of Japan as ethnically Japanese.

Multicultural and biracial people face discrimination even as more of them are rising to prominence — in addition to Osaka and Hachimura, both of whom have received massive endorsement deals from Japanese companies, the reigning Miss Universe Japan is Ghanaian Japanese.

And on Team Japan here at these Olympics, four of 12 men’s basketball players are biracial, as is women’s three-on-three basketball player Stephanie Mawuli and sprinter Abdul Hakim Sani Brown.

To biracial young people who have absorbed microaggressions and attended schools with discriminatory policies all their lives, that representation is meaningful.

“Ever since I was young, I was the only Black Japanese kid in my neighborhood. Whenever I would go out with my mom, people would stare at me — at us,” said 18-year-old Ark Miura, who is Ugandan Japanese and had tears in her eyes when she watched Osaka light the cauldron on television. “I just would feel really awkward and bad about myself when people were always looking at me. … I didn’t know what to do when I had classmates, for example, call me ‘black monkey’ or laugh about my hair when I would put it in braids.”

But coexisting with the happiness at seeing biracial people represent Japan is the sense that Osaka and Hachimura are being used by the Japanese government and Tokyo 2020 organizing committee as a sort of propaganda.

Both earned their lofty statuses — Hachimura is the first Japanese basketball player selected in the first round of the NBA draft — but many feel their promotion provides cover for rampant racism that is a core part of Japan’s history.

Centuries of isolationism and the idea that all Japanese people are members of a family blood-related to the emperor gave way in recent decades to a catchier, if controversial, slogan that Japan is a “one race” nation. Last year, then-deputy prime minister Taro Aso drew criticism for using the phrase.

“The Olympic concept of diversity and inclusion — actually the word we use in Japanese doesn’t really mean ‘inclusion,’ ” Shimoji said. “We use the word that means more like, harmony. And what harmony means here is more like assimilation, everyone being the same, one in harmony. So it’s actually the opposite of what you’re saying in English.”

As it pertains to the Olympics, Japan has worked for years to put on a diverse show for the world.

In 2013, when Tokyo organizers made their bid to the International Olympic Committee to host the 2020 Games, they chose broadcast journalist Christel Takigawa to present on behalf of the bid team. Takigawa, born in Paris to a Japanese mother and a French father, delivered her speech in French.

The front-facing shows of diversity don’t square with real-life experiences.

Baye McNeil, a Black New York native who has lived in Japan for 17 years and writes columns for the English-language newspaper the Japan Times, has seen firsthand the xenophobia and racism lurking in some corners of society.

Showing outward respect and welcoming foreign visitors is a valued concept in Japanese culture called “omotenashi.” But in everyday life — as in, among those not volunteering at Tokyo 2020 working to show the best of the country to thousands of visitors pouring in — it isn’t uncommon for subway riders to move seats if a non-Japanese person sits down next to them. It’s more difficult for foreigners to rent apartments or buy houses. It is common for public schools to require students to dye their hair jet black and straighten it to fit in with the Japanese ideal.

“They will very politely spit in your face, wipe it off and say, 'So sorry about that,’” McNeil said. He wasn’t surprised to see negative online comments about Osaka intensify when she lost her third-round match to Marketa Vondrousova following a two-month break for mental health purposes. As in other countries, mental health is under-discussed and still highly stigmatized in Japan.

“I think people are really disappointed, and then they take into consideration how misrepresented that story about her mental illness was here in Japan,” McNeil said. “And also the bad press we got in Black Lives Matter during the U.S. Open [last year], put all that in the cauldron, and what’s going to come out? The negative stuff. And that’s what I’m seeing now: the backlash of everything, not just her losing but just some negative feelings that have been around for a while.”

Those lingering feelings that have bubbled into loud online hate are what conflict Miura when she considers whether attitudes toward biracial people are shifting in Japan. At 16 years old, she was so fed up with the constant bullying in her public school in the Japanese countryside that she founded the organization African Youth Meetup, a community for Japanese kids with African roots.

This summer, two years later, she was chosen to participate in the torch relay as the Olympic flame made its way toward Tokyo — thanks to an essay she wrote about being bullied in school.

“I posted [the video], and I got likes from all the people who said s--- about me in junior high school,” Miura said. “I was like, ‘Okay!’ But they didn’t reach out to me personally, so like, ‘okay.’ ”

The teen ultimately feels good about seeing more people who look like her on Japanese television and serving as spokespeople for major companies, if only because she believes it will help people expand their vision of what it is to be Japanese.

At the same time, when asked whether she feels a strong connection to Japan after facing years of discrimination and seeing a constant drip of online hate against Osaka, Miura hesitates. She eventually says she will continue to watch some of the Olympics despite not being much of a sports fan, most likely the soccer competition. She probably will back Team Japan.

“At the end of the day, I have Japanese nationality and a Japanese passport. But I’m not, like, the typical Japanese that someone would imagine,” Miura said. “So, yeah. It is my home country. And it’s nothing more than that.”

Simon Denyer contributed to this report from Tokyo.