The effectiveness of perioperative administration of thymopentin in preventing postoperative infection was evaluated in 206 patients with cancer (54 gastric, 152 colorectal) who underwent elective major surgery. Comparable subsets of patients were obtained with respect to age (proportion over 65 years) and nutritional status (patients with serum albumin level less than 30 milligrams or weight loss of 10 per cent or more of usual body-weight were considered to be malnourished). Patients were then randomly assigned to a control group or to a group receiving thymopentin. All patients received perioperative short-term antibiotic prophylaxis and postoperative parenteral nutrition. Levels of CD3-, CD4- and CD8-positive T cell subsets were evaluated before and after surgery in 20 (ten elderly) patients from each group. The severity of postoperative infection was evaluated using a sepsis score. In elderly patients thymopentin prevented the postoperative drop in CD3- and CD4-positive T cell subpopulations that was observed in controls (P < 0.05d). The postoperative infection rate was 17.5 per cent in the group given thymopentin and 24.3 per cent in controls (P not significant). The mean (s.d.) sepsis score was 6.7 (3.1) in the group receiving thymopentin and 9.4 (5.8) in controls (P not significant). Considering only elderly patients, the mean (s.d.) sepsis score was significantly lower in those treated with thymopentin than in control patients (6.9(2.1) versus 11.3(4.7)). In conclusion, administration of thymopentin did not significantly reduce the postoperative infection rate. However, it prevented the drop in number of CD3- and CD4-positive T cells after operation and reduced the severity of postoperative infection in elderly patients.