Levels of unconscious racist and sexist bias have been reduced by manipulating the way the brain learns during sleep.
A team at Northwestern University, Chicago, played sounds while people slept to trigger and enforce memories of an exercise earlier in the day.
The trial on 40 people, published in the journal Science, showed the changes lasted at least a week.
Experts said the findings had potential in many situations, but also raised ethical questions.
Sexual and racial prejudice are common but may often be unintentional, says the Northwestern team.
They cite studies in computer games when people chose to shoot black characters more often than white ones or men being favoured over women despite having identical job applications.
People's prejudices were assessed with a series of publicly available tests at the start of the study.
They were then given "counter-bias training". During the session, pictures of faces were paired with words that were the opposite of widely-held stereotypes.
So female faces were paired with words like "maths" or black faces with positive words like "sunshine".
Distinctive sounds were played during the counter-bias training and were played again at low volume during a 90-minute afternoon nap.
The result was a reduction in sexual and racial bias scores, which persisted for at least a week.
So could this really make someone less sexist or racist?
Prof Ken Paller, the director of the cognitive neuroscience programme at Northwestern University, told the BBC News website: "We didn't have people interact with or make decisions about other people, so that sort of experiment is needed to know the full effects of the methods we used.
"But we suggest that modifying unconscious social bias is likely to influence the extent to which decisions are influenced by racist or sexist attitudes."
He argues the technique may have potential in tackling addiction or unhealthy eating.
In a commentary, Gordon Feld and Jan Born from the University of Tubingen praised the study saying: "This is the first to demonstrate that this method can be used to break long-lived, highly pervasive response habits deeply rooted in memory."
But they cautioned that sleep was a vulnerable state in which people did not have "wilful consciousness".
They added: "However, Aldous Huxley's description of a dystopian 'brave new world' where young children are conditioned to certain values during sleep reminds us that this research also needs to be guided by ethical considerations."
Prof Paller said there were similarities to subliminal advertising and that there was an ethical discussion to be had.
However, he continued: "More importantly, perhaps, is the question of whether people in positions of authority in society, such as judges and police officers, and perhaps people who make hiring decisions, should have their unconscious bias evaluated and perhaps trained to some standard."