Background: While the underlying mechanisms of agitation are not fully understood in people with Alzheimer's disease and related disorders, research suggests that dysregulated neuroendocrine processes, including the hypothalamic-pituitary-adrenal axis, may play a role. Objective: This study aimed to explore the associations between salivary cortisol, melatonin at baseline, and agitation both at baseline and at post-intervention. Methods: This study was a secondary analysis of a two-group, randomized, parallel designed clinical trial of 210 people living with cognitive impairment. Agitation, salivary cortisol, and salivary melatonin were measured at baseline and four weeks. Salivary cortisol and melatonin indicators were generated through three timepoints of cortisol and melatonin collection across the two consecutive days. Presence of agitation was measured using the Neuropsychiatric Inventory. Logistic regressions were conducted to achieve the aim. Results: A significant association was found at baseline between diurnal cortisol slope and agitation (OR = 0.03, p = 0.029), there were no relationships between all other cortisol or melatonin indicators with agitation. Cortisol awaking response (OR = 0.16, p = 0.048), its percentage (OR = 0.27, p = 0.021) and its increase higher than 50% (OR = 0.09, p = 0.009), were significant with agitation at four weeks. Conclusions: Given the potential link between cortisol and agitation, exploring cortisol-lowering interventions like minimizing environmental stressors, smoothing transitions to different situations, stress-reduction techniques, and behavioral therapies may aid in managing agitation in older adults with cognitive impairment.