It was reported at the weekend that the Tykes had erroneously submitted a bid for the 21-year-old to a fans' website.
Mallan scored 11 goals this season to help the Buddies retain their Scottish Championship status.
Saints chief executive Tony Fitzpatrick said: "I understand supporters will be sad to see Stevie go but we feel it is the right time."
Find all the latest football transfers on our dedicated page.
Championship club Barnsley have signed St Mirren midfielder Stevie Mallan for an undisclosed fee on a two-year deal.