Townsend, 20, joined the League One side on a Youth Loan earlier this month and has now signed a three-year deal.
Townsend, who graduated through the Club’s Academy has made one appearance for Barnsley, coming against Scunthorpe United in the Capital One Cup.
The Solihull-born goalkeeper had a successful loan spell at Conference side Lincoln City last season where he made 17 appearances in his second stint with the Imps.
The former Alderbrook School pupil, also helped Blues U21s to victory in the Birmingham Senior Cup final against Nuneaton Town - the first time that Blues had won the competition in seven seasons.
Captain of Blues Under-21s, Townsend signed a two–year deal with the Club in the summer.
But the arrival of Adam Legzdins and then Tomasz Kuszczak put him down the pecking order in his quest to play regular competitive football.
Everyone at the Club would like to wish Nick all the best in the future.