We report a final assessment of the energy spectrum above 4 x 10(17) eV which has been produced from measurements made at the Haverah Park extensive air shower array between 1968 and 1987. The methods of analysis are described in some detail and we confirm that the slope of the energy spectrum from 4 x 10(17) eV to 4 x 10(18) eV is steeper (gamma = -3.14(-0.06)+0.05) than the value (gamma = -3.01 +/- 0.02) measured at lower energies, and that above 10(19) eV the spectral slope flattens again (gamma = -2.7 +/- 0.2). The integral intensity at 10(18) eV is (1.8 +/- 0.1) x 10(-12) m-2 s-1 sr-1, or about 60 events km-2 sr-1 year-1. We have demonstrated that there is no evidence for any cut-off in the spectrum at least to 10(20) eV, close to the highest energy observed. At 10(20) eV our estimate of the integral intensity (based on only eight events) is (3 +/- 2) x 10(-16) m-2 s-1 sr-1, or about one event per km2 per century per steradian. Thus to explore this energy range and the decade beyond in greater detail requires exposure rates of at least 1000 km2 per year. We have compared our measurements with data from Akeno, Fly's Eye and Yakutsk and find good agreement except with the claim by the Soviet group that the spectrum cuts off at about 5 x 10(19) eV. This conflict is not yet resolved but the energy calibration used in the Yakutsk experiment, when applied to Haverah Park data, appears to agree remarkably well.