Dietary habits and vascular risk factors promote both Alzheimer's disease and cognitive impairment caused by vascular factors1-3. Furthermore, accumulation of hyperphosphorylated tau, a microtubule-associated protein and a hallmark of Alzheimer's pathology4, is also linked to vascular cognitive impairment5,6. In mice, a salt-rich diet leads to cognitive dysfunction associated with a nitric oxide deficit in cerebral endothelial cells and cerebral hypoperfusion7. Here we report that dietary salt induces hyperphosphorylation of tau followed by cognitive dysfunction in mice, and that these effects are prevented by restoring endothelial nitric oxide production. The nitric oxide deficiency reduces neuronal calpain nitrosylation and results in enzyme activation, which, in turn, leads to tau phosphorylation by activating cyclin-dependent kinase 5. Salt-induced cognitive impairment is not observed in tau-null mice or in mice treated with anti-tau antibodies, despite persistent cerebral hypoperfusion and neurovascular dysfunction. These findings identify a causal link between dietary salt, endothelial dysfunction and tau pathology, independent of haemodynamic insufficiency. Avoidance of excessive salt intake and maintenance of vascular health may help to stave off the vascular and neurodegenerative pathologies that underlie dementia in the elderly.