The 32-year-old Serbian has signed a two-and-a-half-year contract with an option of another year.
“I had a strong desire to return to Russia,” Ivanovic, who scored five goals in 54 matches for Lokomotiv Moscow in 2006-07 before joining Chelsea in 2008, told the Zenit website.
“I feel high motivation and a desire to continue playing at the highest level.”
Ivanovic won two Premier League titles, one Champions League, one Europa League, three FA Cups and one League Cup during his spell at Chelsea.
He is one of only five foreign players – along with Didier Drogba, John Obi Mikel, Petr Cech and Gianfranco Zola – to reach the 300-game landmark for the Blues.
Chelsea tweeted that Ivanovic, who has 82 caps and is captain of Serbia, was “a true Chelsea legend”.
Zenit are second in the Russian Premier League, five points off leaders Spartak Moscow.
The Russian league is on a three-month winter break and will resume in March.
Would you like to place a soccer bet? Click here to get started in 3 easy steps.