Birmingham City have signed former Swindon Town skipper Paul Caddis for an undisclosed fee on a three-year deal.
The 25-year-old Scot was first loaned to Blues a year ago after falling out with ex-Swindon manager Paolo Di Canio.
After a successful season on loan at St Andrew's, Caddis was hopeful of making the move permanent, only for Birmingham to fail with a string of offers.
But Blues' need for a right-back was enhanced by an injury to Neal Eardley in Saturday's 1-1 draw with Ipswich.
Summer signing Eardley could be sidelined for several months after suffering knee ligament damage.
And the cash-strapped, up-for-sale Championship club have now found the funds to complete the signing.
Irvine-born Caddis, who still had a year to run on his contract at the County Ground, was thought be the target for several second-tier clubs.
Caddis, who joined Swindon from Celtic in 2010, was made captain by Di Canio during the 2011-12 season, in which they won the League Two title.
But Caddis was stripped of the armband last summer and sent out on loan after Di Canio suggested that the defender had "changed his attitude".
Despite struggling with a shoulder injury, Caddis made 28 appearances for Blues last season, mostly at right-back.
Meanwhile, Birmingham, who cancelled striker Marlon King's contract on Friday, to reduce their wage bill, have released 19-year-old midfielder Eddy Gnahore by mutual consent.