Lewis Montrose aims to help Chesterfield win promotion next season after agreeing a permanent deal at Saltergate.
The midfielder has spent the past two months on loan at Chesterfield from Wigan Athletic and has made 11 appearances.
He enjoyed two spells on loan at Cheltenham Town earlier in the season and is out of contract at Wigan in the summer.
Montrose has now signed a two-year pre-contract agreement with Chesterfield and is looking forward to joining up with the Spireites permanently.
"I am delighted to be joining Chesterfield on a long-term basis as I have really enjoyed being with the club on loan and everyone has made me so welcome," Montrose told the club's official website.
"I am looking forward to progressing my career with the Spireites and want to play my part in seeing us get promoted next season."