Neuroscientists have identified the brain regions responsible for encoding and consolidating emotional memories during sleep.