If anything, exercising up to four hours before bed-time has a positive effect on sleep quality, although it's a very mild one. But it certainly doesn't stop you having a good night's sleep, say researchers at the Institute of Human Movement Sciences and Sport in Zurich.
They looked through 23 previously-published studies and discovered that people who had exercised or taken part in some sporting activity in the evening still enjoyed deep sleep for around one-fifth of the time they were sleeping. The deep-sleep period for people who hadn't exercised in the evening was slightly lower.
Although the differences were small—there were just a couple of percent points between the two—they were significant because deep sleep is vital for physical recovery.
The one exception is vigorous exercise just one hour before going to bed. Exercising so close to bedtime could affect the quality of sleep, but even here the evidence is not conclusive as it was based on just one study, the researchers say.
They reckon that late-night exercise doesn't give the body long enough time to recover; the hearts of the participants were still beating 20 beats per minute faster than their usual resting rate when they went to bed.
(Source: Sports Medicine, 2018; doi: 10.1007/s40279-018-1015-0)