The 23-year-old has been at Old Trafford since the age of eight and spent last season on loan at League Two Macclesfield Town.
His performances helped the Silkmen avoid relegation and earned him the club's Player of the Year award.
"He was our first choice all along and I'm delighted we have got the deal done," said manager Nigel Clough.
Need a VPN? Or seeking to switch? Then support Tribal Football by clicking here to sign up with our official partners NordVPN. Not only will you receive the best VPN experience, but also great discounts by signing up via Tribal Football. Thanks for your support!