The former Hearts and MK Dons boss has been in charge since October 2018 and has led the team to the top of the Ladbrokes Championship after missing out in the play-off final to St Mirren back in May.
Assistants Gordon Forrest and Lee McCulloch have also extended their contracts as the club seek a return to the top flight of Scottish football.
Neilson told the club website: "This was an easy decision to make. We are trying to build something special here and if you look at where the club was a year ago, it is night and day now.
"There is a real positive energy around the place - we have a great dressing room and a fantastic support staff. The focus is on achieving our target."