Hansford started down in 14th but picked his way through the field and passed pole-sitter Adam Bressington on the final lap to claim only his second career race victory.
Saturday morning's race exploded into life on the very first lap as drivers struggled for grip on the dusty street circuit.
Contact between Paul Freestone and Ryal Harris on the exit of Turn 7 sent Harris spinning across the track while Freestone also ended up in the fence.
Both cars sustained heavy damage and Steve Johnson was very lucky not to be collected by Harris as the #58 car turned through 180 degrees in front of him.
Harris, who was trying to evade Freestone but couldn't avoid being tagged, was hobbling badly as a medic led him away from the scene of the crash.
When racing restarted after three laps behind the Safety Car, Hansford was a man on a mission.
He was up to second by Lap 7 and forced Bressington to defend his lead as the gap narrowed.
Hansford almost got by on the penultimate lap and when he took the long way round with just a few corners to go, Bressington was powerless to hold on any longer.
Cameron Tilley finished third, just over two seconds back.
The third TCM race of the weekend is scheduled for 10:35 local time/11:05 AEDT on Sunday.