We investigate constraints on cosmic reionization extracted from the Planck cosmic microwave background (CMB) data. We combine the Planck CMB anisotropy data in temperature with the low-multipole polarization data to fit LCDM models with various parameterizations of the reionization history. We obtain a Thomson optical depth tau=0.058 +/- 0.012 for the commonly adopted instantaneous reionization model. This confirms, with only data from CMB anisotropies, the low value suggested by combining Planck 2015 results with other data sets and also reduces the uncertainties. We reconstruct the history of the ionization fraction using either a symmetric or an asymmetric model for the transition between the neutral and ionized phases. To determine better constraints on the duration of the reionization process, we also make use of measurements of the amplitude of the kinetic Sunyaev-Zeldovich (kSZ) effect using additional information from the high resolution Atacama Cosmology Telescope and South Pole Telescope experiments. The average redshift at which reionization occurs is found to lie between z=7.8 and 8.8, depending on the model of reionization adopted. Using kSZ constraints and a redshift-symmetric reionization model, we find an upper limit to the width of the reionization period of Dz < 2.8. In all cases, we find that the Universe is ionized at less than the 10% level at redshifts above z~10. This suggests that an early onset of reionization is strongly disfavoured by the Planck data. We show that this result also reduces the tension between CMB-based analyses and constraints from other astrophysical sources.