Study Objectives: Task-switching is an executive function involving the prefrontal cortex. Switching temporarily attenuates the speed and/or accuracy of performance, phenomena referred to as switch costs. In accordance with the idea that prefrontal function is particularly sensitive to sleep loss, switch-costs increase during prolonged waking in humans. It has been difficult to investigate the underlying neurobiological mechanisms because of the lack of a suitable animal model. Here, we introduce the first switch-task for rats and report the effects of sleep deprivation and inactivation of the medial prefrontal cortex. Design: Rats were trained to repeatedly switch between 2 stimulus-response associations, indicated by the presentation of a visual or an auditory stimulus. These stimulus-response associations were offered in blocks, and performance was compared for the first and fifth trials of each block. Performance was tested after exposure to 12 h of total sleep deprivation, sleep fragmentation, and their respective movement control conditions. Finally, it was tested after pharmacological inactivation of the medial prefrontal cortex. Settings: Controlled laboratory settings. Participants: 15 male Wistar rats. Measurements & Results: Both accuracy and latency showed switch-costs at baseline. Twelve hours of total sleep deprivation, but not sleep fragmentation, impaired accuracy selectively on the switch-trials. Inactivation of the medial prefrontal cortex by local neuronal inactivation resulted in an overall decrease in accuracy. Conclusions: We developed and validated a switch-task that is sensitive to sleep deprivation. This introduces the possibility for in-depth investigations on the neurobiological mechanisms underlying executive impairments after sleep disturbance in a rat model.