The 32-year-old was released by League One side Northampton Town last week despite being named player of the year.
Diamond, who began his career with Aberdeen and has also played for Oldham and Burton, played 45 games for the Cobblers in 2016-17.
Stags manager Steve Evans said: "He is a dominant centre-back who is vociferous on the pitch and a leader of men. He is still highly ambitious."
The length of Diamond's contract has not been revealed.
Find all the latest football transfers on our dedicated page.
Mansfield Town have signed experienced centre-back Zander Diamond.