The 28-year-old former Cameroon player had been expected to join Rubin on loan but has signed a permanent deal after terminating his Barca deal.
Song, who left Arsenal to sign a five-year deal with Barcelona in 2012, made 65 appearances for the Catalan club and scored one goal.
He had spent the last two seasons on loan at Premier League side West Ham.
Russian club Rubin Kazan have signed Barcelona midfielder Alex Song on a free transfer.