Self-sustaining oscillations are essential for diverse physiological functions such as the cell cycle, insulin secretion and circadian rhythms. Synthetic oscillators using biochemical feedback circuits have been generated in cell culture. These synthetic systems provide important insight into design principles for biological oscillators, but have limited similarity to physiological pathways. Here we report the generation of an artificial, mammalian circadian clock in vivo, capable of generating robust, tunable circadian rhythms. In mice deficient in Per1 and Per2 genes (thus lacking circadian rhythms), we artificially generate PER2 rhythms and restore circadian sleep/wake cycles with an inducible Per2 transgene. Our artificial clock is tunable as the period and phase of the rhythms can be modulated predictably. This feature, and other design principles of our work, might enhance the study and treatment of circadian dysfunction and broader aspects of physiology involving biological oscillators.