The 23-year-old made 12 appearances for George Burley's side on loan after joining them in October.
And after the defender signed a two-and-a-half-year contract, Burley told the club's website: "Andrew has a bright future ahead of him. There is no doubt in my mind that he has Premier League quality.
"It is very important for the future of the club that we have been able to get him. It is the key to pushing forward."