The website UrbanDictionary.com defines the phrase “I have a black friend” as “the greatest excuse that racists use to try to make it look like they’re not racist.” But does it work? New research suggests this phrase actually does make people appear less racist — at least when it involves Asian Americans.

The study found that people viewed a white man who disparaged minorities as less racist if he was seen with minority friends or mentioned having them. The study was conducted by Australian researchers Michael Thai, Matthew J. Hornsey, and Fiona Kate Barlow. It was published in the journal Social Psychology and Personality Science.

“This article is the first to examine whether minority friendships actually protect majority group actors from observers’ attributions of prejudice. We demonstrated that they do, albeit not fully,” Thai and his colleagues explained.

In their study, 203 white American and 254 Asian American participants viewed a fake Facebook profile belonging to a made-up white male named Jake Miller, whose cover photo showed him being surrounded by no, few, or many Asian friends.

Half of the participants viewed a statement posted on Miller’s Facebook page in which he said either “so sick of Asians right now,” “Asians are annoying,” “can’t stand Asians,” or “way too many Asians around.” The other participants, used as a control group, viewed a statement in which he made similar complaints about squirrels.

As expected, the participants rated Miller as more racist when he complained about Asians than when he complained about squirrels. The participants who saw Miller posting anti-Asian comments rated him as less racist when his Facebook profile showed him surrounded by Asian friends. There was no significant difference between white and Asian participants. Although the participants rated Miller less negatively if he was depicted with minority friends, he was “still perceived more negatively than those who had not made an anti-Asian statement,” the researchers noted.

Thai and his colleagues then conducted a follow-up study to examine whether verbally alluding to having minority friends could have the same effect.

In this second study, another group of 85 white Americans and 76 Asian Americans viewed a fake Facebook profile of a white man who made anti-Asian comments. The man preceded his comment with either “one of my best friends is Asian, but … ,” “some of my best friends are Asian, but …” , “most of my best friends are Asian, but …,” or posted no such disclaimer.

The man was viewed as less racist when he mentioned having one or more Asian friends. The man was also judged to be more integrated with Asian people when he mentioned having one or more Asian friends. Unlike the first study, white participants were slightly less likely than Asian participants to rate the man as racist overall.

“When a majority actor’s minority friends were visually evident (Study 1) or verbally referenced (Study 2) upon making a plausibly racist statement, they were perceived as less racist and more embedded within the minority group (Study 2) compared to an actor making the same statement without minority friends. Additionally, the statement was construed as better intentioned, less offensive, and less upsetting,” Thai and his colleagues wrote.

“Importantly, minority group observers were just as likely as majority group observers to give moral license to the majority group target expressing racism if he displayed or referenced minority friends.”

Thai and his colleagues said future research should examine other minority groups, such as black Americans. “It is possible that the minority friendship effect may vary as a function of the disadvantaged group in question,” they noted.