The 26-year-old proved a massive success during his month loan stay, before picking up an ankle injury in the 3-1 defeat at Notts County.
Rankin arrived at Blundell Park as part of the deal that saw Michael Boulding join the Tykes last month. His future at Oakwell was already in doubt but his celebrations in from of the Barnsley fans after scoring against them sealed his fate.
Rankin has signed a contract until the end of the season but it is thought that should Town stay in the second division, a two-year deal will be arranged.
The ankle injury that has kept Rankin on the sidelines in recent weeks has cleared up almost and the hitman could be in the squad for Saturday's relegation visit to Chesterfield.