Vagner Love free to join Flamengo
"CSKA and Flamengo had reached an agreement about Vagner's transfer to the Brazilian club," the army club said on their website.
CSKA did not disclose the transfer fee but media reports put the figure at around 10 million euros, which will be paid in three installments for the 27-year-old striker.
He joined CSKA in 2004, helping them to two domestic league titles, five national cups and the UEFA Cup in 2005 when they became the first Russian club to win a European trophy.
Vagner, easily recognisable on the pitch with his distinctive coloured braids, had been CSKA's top striker for most of his seven seasons with the club, scoring 117 goals in 244 games.
Despite his prolific scoring record in Russia's top flight, the Brazilian has always maintained his desire to return to his home country.
He was loaned to Palmeiras, his first professional club, in 2009, but after struggling there, moved to Flamengo for another six months before returning to CSKA the following year.
"I've spent seven years in Russia and I've always felt love and support from the club and its fans," Vagner was quoted as saying by CSKA's website.
"I've embraced CSKA with all my heart. I've had great time here - we've won lots of titles together... I'll never forget this. CSKA will always remain part of my life."