The functions of sleep remain an unresolved question in biology. One approach to revealing sleep's purpose is to identify traits that explain why some species sleep more than others. Recent comparative studies of sleep have identified relationships between various physiological, neuroanatomical and ecological traits, and the time mammals spend in rapid eye movement (REM) and non-REM sleep. However, owing to technological constraints, these studies were based exclusively on animals in captivity. Consequently, it is unclear to what extent the unnatural laboratory environment affected time spent sleeping, and thereby the identification and interpretation of informative clues to the functions of sleep. We performed the first electroencephalogram (EEG) recordings of sleep on unrestricted animals in the wild using a recently developed miniaturized EEG recorder, and found that brown-throated three-toed sloths (Bradypus variegatus) inhabiting the canopy of a tropical rainforest only sleep 9.63 h d(-1), over 6 h less than previously reported in captivity. Although the influence of factors such as the age of the animals studied cannot be ruled out, our results suggest that sleep in the wild may be markedly different from that in captivity. Additional studies of various species are thus needed to determine whether the relationships between sleep duration and various traits identified in captivity are fundamentally different in the wild. Our initial study of sloths demonstrates the feasibility of this endeavour, and thereby opens the door to comparative studies of sleep occurring within the ecological context within which it evolved.