The Blues have not disclosed the fee for the 25-year-old, but Goal understands they will pay the Russian club €37 million for the winger.
Tottenham had been the favourites to sign Willian, having agreed a fee with Anzhi and personal terms in principle with the player, who even underwent a medical.
But when Spurs then refused to improve their salary package, the Brazilian's representatives offered him to other clubs and long-time admirers Chelsea made their move.
A statement on the club's official website reads: "Chelsea Football Club can confirm an agreement has been reached with both Willian and his club Anzhi Makhachkala for the transfer of the Brazilian player.
The transfer is subject to a work permit hearing on Wednesday."
Willian becomes Chelsea's third summer signing, following the arrivals of Andre Schurrle from Bayer Leverkusen and Marco van Ginkel from Vitesse Arnhem, while Wayne Rooney remains a target.