Ivanovic's contract at Stamford Bridge was set to expire at the end of the season, and he has opted for a new challenge at Zenit, signing a two-and-a-half-year deal.
He made nearly 400 appearances at Stamford Bridge and won two Premier League titles as well as the Champions League, and also scored a stoppage-time winner as Chelsea beat Benfica 2-1 in the 2012-13 Europa League final.
However, he fell out of favour with Blues boss Antonio Conte following the latter's switch to a three-man backline last September and had been heavily linked with a winter exit.
"I can say I'm very happy to come here, and to be at a big club like Zenit, I hope together we'll have success," he told the club's official website after they had announced the deal.
"I had a very big hope to come back to Russia and to play here. I am motivated and I think that I can play for many more seasons at the top level.
"I can say that I am excited to be here and everything went smoothly.
"I am happy just to play. I am happy in the centre or on the right. That's probably a question for the manager but I am happy to play in any position."