The 26-year-old defender posted on Twitter: "Thank you for 4.5 years but it is time for a new challenge and chapter in my career.
"To be your captain over the last 18 months has been a massive honour.
"To the players - it's been one hell of a season with a great dressing room to manage and there is no doubt that you all deserve to be achieving the best in your careers whatever they may be.
"I have met some friends and family for life. I wish you all the best in your careers."
He added: "To ALL the staff thank you for everything you have done for me - to give me a platform again to showcase my talent and develop me into who I am today. I couldn't have done it without you all.
"Thank you yo Lou for most importantly looking after my family at home / away - you made us feel at home, that gives you as a player extra %"
"We have loved every moment with this club and you hold a very special place in our hearts.
"To the fans - since that first day you made me fell one of your own and I'm so glad that the past few seasons the bond between the club, players, fans has grown stronger and together it is moving in the right direction.
"I wish Milly [manager, Chris Millington] and all his staff all the best next year and you fully back him with the squad he will assemble - he fully deserves this opportunity.
"I hope to be back one day."
FC Halifax Town posted on Twitter: "Niall was integral in the side that had the best defence and home record in the league last campaign. We wish Niall and his family the very best."