The 26-year-old has also previously played for Heart of Midlothian, Raith Rovers, Sheffield United and Fleetwood Town.
Saints boss Tommy Wright also secured the deadline-day signing of Celtic right-back Anthony Ralston on loan for the rest of the season. The 20-year-old has had previous loan spells at Queen's Park and Dundee United.