The 26-year-old joined the Lions in August 2016 and made 43 appearances last term, helping the club achieve promotion to the Championship in the process.
However, Butcher fell down the pecking order this season and, following Millwall's announcement of his contract being terminated by mutual consent, he has now penned a deal at the One Call Stadium.
"There were [other] clubs in for me, but after speaking with the manager and what he's trying to build, it was a no-brainer," Butcher told the Stags' website. "I insisted to my agent that we get the deal done as soon as possible. I'm really happy to get it done.
"The club's ambition, where it's going and where it wants to be, and working with a manager like Steve who knows how to win promotions made me want to sign."
Butcher graduated from the Tottenham Hotspur youth academy in 2009 and has previously played for the Spurs senior team, Dundee United and Burton Albion.