Christian Tello’s strike put the Catalans ahead, but an own goal from Dani Alves and a Romulo strike put the Russians in front.
Messi then struck twice to save Barcelona and give them three points in the end.
“Things got complicated but we kept pressing and we managed to turn it around,” Messi told Spanish television afterwards.