Pooled analysis of the data showed that an exercise programme before surgery reduces the complication rate afterwards by 48 per cent.
It also reduced length of hospital stay by nearly three days for patients with lung cancer, according to the study published in the British Journal of Sports Medicine.
"Postoperative complication is a major concern for patients undergoing [cancer] surgery," said Daniel Steffens, from the University of Sydney in Australia.
"The findings may also impact on healthcare costs and on patients' quality of life, and consequently have important implications for patients, healthcare professionals and policy makers," he said.
The exercise programmes, which were compared with standard care or advice, lasted from one to four weeks, with the average length a fortnight.
Trials that reported more numerous sessions of exercise had better results, suggesting that there may be a dose response effect, the researchers said.