This paper reports fabrication, characterization, and testing of the thermal stability of ZnO-based Schottky ultraviolet photodetectors. The ZnO thin film was grown on a p-type Si 〈100〉 substrate by the sol-gel technique. The surface morphological and the structural properties of the thin film were studied by an atomic force microscope (AFM) and a scanning electron microscope (SEM). For the investigation of the surface chemical bonding, X-ray photoelectron spectroscopy (XPS) measurements were also performed. The <i xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">I</i> - <i xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">V</i> characteristics of the Schottky barrier photodetector were studied, and the parameters such as ideality factor, leakage current, and barrier height were extracted from the measured data at room temperature. With applied bias voltages in the range from -3 to 3 V, the contrast ratio, responsivity, detectivity, and quantum efficiency of the photodetectors were measured for an incident optical power of 0.1 mW at 365-nm wavelength. The electrical and optical study revealed that the performance of the device improves with increasing post metal deposition annealing temperature up to 100°C. The device exhibited excellent thermal stability in the annealing temperature range of 100°C to 200°C. For annealing temperatures beyond 200°C, the performance of the device degrades drastically. It was also found that at under 200°C, there is a harmonious correlation between the photoresponse and electrical characteristics of the device. Above this temperature, there is no correlation between the variations of photoresponse and electrical characteristics with increasing annealing temperature. The variation of the electrical and photoresponse properties of the Schottky photodetector subjected to different post-fabrication annealing can be attributed to the combined effects of interfacial reaction and phase transition during the annealing process.