Background: Circadian rhythm disturbance is common postoperatively in older patients with hip fractures, which may contribute to the development of postoperative delirium (POD). As a reliable biomarker of endogenous circadian rhythms, melatonin regulates the sleep-wake cycle and environmental adaptation, and its secretory rhythm may be modified by anaesthesia and surgery. This study compared the impact of subarachnoid anaesthesia (SA) and general anaesthesia (GA), on the peak of melatonin secretion (primary outcome), the circadian rhythm of melatonin, cortisol and sleep, and the POD incidence (secondary outcome). Methods: In this prospective cohort observational study, hip fracture surgery patients were enrolled and assigned to receive either SA or GA. Postoperative plasma melatonin and cortisol levels were dynamically measured every six hours on seven time-points, and the circadian rhythm parameters including mesor, amplitude, and acrophase were calculated. Subjective and objective sleep assessments were performed by sleep diaries and sleep trackers, respectively. The Confusion Assessment Method was used twice daily by a specific geriatrician to screen for POD occurrence. Findings: In a cohort of 138 patients who underwent hip fracture surgery, the circadian rhythm disruption of the patients in the GA group (n=69) was greater than the SA group (n=69). Compared with SA, GA provided the lower peak concentration, mesor, and amplitude of melatonin secretion on postoperative day 1 (p < 0.05). Patients in the GA group experienced higher awakenings, more sleep deprivation, and poor sleep quality on surgery day (p < 0.05). A proportion of 12 patients in the SA group (17.4%) and 24 patients in the GA group (34.8%) experienced POD (p = 0.020). Interpretation: These results suggest that SA may be superior to GA in elderly patients undergoing hip fracture surgery as SA is associated with less impairment of the melatonin rhythm and sleep patterns, and fewer POD occurrences.