The effort of trying not to appear racist can be mentally draining - even for people who are not consciously prejudiced, say scientists.
Brain activity was measured
A team from Dartmouth College in the US found white people performed less well on mental tasks after an interaction with a black person.
They suggest the test subjects expended mental energy - often subconsciously - trying to control racial bias.
The study, which also showed that it is possible to carry out brain scans to detect racist attitudes, is published in the journal Nature Neuroscience.
The researchers used a computer test to assess racial bias in 30 white people.
The volunteers were deemed to be more racially biased if they took longer to associate white people with negative concepts, and black people with positive concepts.
They then interacted with either a black or a white individual, and afterwards they were asked to complete an unrelated task designed to measure their mental performance.
Separately, sophisticated scanning technology was used to measure brain activity when the volunteers were presented with photographs of unfamiliar black or white men.
Lead researcher Dr Jennifer Richeson said: "We found that white people with higher scores on the racial bias measure experienced greater neural activity in response to the photographs of black males.
"This heightened activity was in the right dorsolateral prefrontal cortex, an area in the front of the brain that has been linked to the control of thoughts and behaviours.
"Plus, these same individuals performed worse on the cognitive test after an actual interaction with a black male, suggesting that they may have been depleted of the necessary resources to complete the task."
No such drop in performance on the tasks was recorded after people interacted with others of the same racial group.
Dr Richeson argued that most people find it unacceptable to behave in prejudiced ways during interracial interactions and make an effort to avoid doing so - regardless of their actual level of racial bias.
These efforts may leave people temporarily depleted of the resources needed to perform well on mentally challenging tasks.
She told BBC News Online: "The study provides striking evidence for the theory that individuals perform worse on certain cognitive tasks after interracial interactions because they were attempting to control their thoughts, behaviour, and/or emotions during the interaction."
Professor Graham Richards, an expert in race and psychology at Staffordshire University, told BBC News Online that racial bias was not the same as overt racism, and was often something of which the subject was not conscious.
He also questioned whether it was feasible to draw general conclusions from a small sample of volunteers, who were all young American university students.
And he speculated that their response would not be replicated in other groups of people who, perhaps did not harbour a sense of guilt about the way black people were treated in their society.
The issue of whether black people reacted the same way when interacting with white people had not been addressed either, he said.
"This is an interesting finding but its broader significance, importance and generalisability simply cannot be ascertained or even sensibly speculated about at this stage.
"Though not a criticism of the research per se one could foresee it being misused and misunderstood to imply that 'mixing with black people is bad for you'."
Professor Alick Elithorn, an expert in neuropsychology from Oxford, said it was difficult to design research to examine racism as there were many factors which might cloud the issue.
However, he said: "There does tend to be an age-related effect. The young tend to be inquisitive, inquiring and friendly, while older people tend to be more prejudiced and suspicious."