Obstructive sleep apnea syndrome (OSAS) is usually associated with multiple cardiovascular disorders, including myocardial hypertrophy. Melatonin protects the heart from damaging conditions. However, whether melatonin alleviates heart damage induced by chronic intermittent hypoxia (CIH) is unknown. We investigated the melatonin-induced protective role of AMPK-regulated autophagy in the myocardium by exposing rats to CIH and treating them with melatonin or saline daily for six weeks. In vivo, CIH induced significant myocardial hypertrophy; this trend was strikingly reversed by melatonin. Moreover, AMPK activation and autophagy was enhanced, and the number of autophagosomes increased. CIH induced apoptosis of cardiomyocytes; this was significantly mitigated by melatonin. In vitro, CIH induced hypertrophic changes in cardiomyocytes; this effect was significantly reversed by melatonin. Autophagy decreased after AMPK inhibition, and we found that autophagy was required for the protective function of melatonin. Our results suggest that melatonin ameliorates cardiac hypertrophy caused by CIH by inducing autophagy via the AMPK pathway and by autophagy-regulated apoptosis.