The 24-year-old has thereby sacrificed a chance to help Shakhtar progress further in the Champions League - the Ukrainians host Borussia Dortmund in the first leg of their last-16 tie on February 13.
Willian could also be jeopardising his international ambitions with Brazil.
Full name Willian Borges da Silva, he scored four goals in the early stages of the Champions League and was hugely influential as Shakhtar went through from their group along with Juventus, at the expense of holders Chelsea.
He spent five-and-a-half years with Shakhtar after joining from Corinthians, winning four Ukrainian League, three Ukrainian Cups and one UEFA Cup in 2009.
"Shakhtar thanks Willian for the years spent at the club, for his goals and professionalism. We wish our former player success with his new team," the Ukrainians said on Friday.
Willian's ability to spray passes nonchalantly around the pitch with unerring accuracy makes him a rare commodity in modern Brazilian football which has tended to prefer players with speed and power in recent years.
The five-times world champions are sometimes inclined to overlook players based in Eastern Europe and he has won only two caps for his country.
Moving to Anzhi may push him even further out of the Brazilian spotlight as Shakhtar were at least involved in the Champions League.
Romanian coach Mircea Lucescu said he tried to persuade the player to stay in Ukraine.
"It's his personal decision which we must respect," Lucescu told Russia's Sport Express newspaper. "He found a club willing to pay the buyout clause and I could not change anything.
"I tried to talk football, I thought his decision was hasty and poorly balanced.
"Willian is like a son to me. He was the height and stature of a child when he arrived here and leaves as a mature 24-year-old player," added Lucescu.
"When he left I told him that with us he would have achieved even more than he has already."
The club from the volatile North Caucasus region have reached the last 32 of the Europa League but are barred from hosting matches in their own stadium in European competition for security reasons.
Anzhi meet Hanover 96 in the first leg on February 14.