New compilations of records of ancient and medieval eclipses in the period 720 BC to AD 1600, and of lunar occultations of stars in AD 1600-2015, are analysed to investigate variations in the Earth's rate of rotation. It is found that the rate of rotation departs from uniformity, such that the change in the length of the mean solar day (lod) increases at an average rate of +1.8 ms per century. This is significantly less than the rate predicted on the basis of tidal friction, which is +2.3 ms per century. Besides this linear change in the lod, there are fluctuations about this trend on time scales of decades to centuries. A power spectral density analysis of fluctuations in the range 2-30 years follows a power law with exponent -1.3, and there is evidence of increased power at a period of 6 years. There is some indication of an oscillation in the lod with a period of roughly 1500 years. Our measurements of the Earth's rotation for the period 720 BC to AD 2015 set firm boundaries for future work on post-glacial rebound and core-mantle coupling which are invoked to explain the departures from tidal friction.