Chelsea have confirmed a deal  has been agreed to sign attacking midfielder Willian from Anzhi Makhachkala, subject to a work permit hearing on Wednesday.

The 25-year-old Brazilian was close to joining Tottenham after having a medical last Wednesday.

But it is understood the Blues made their move at around 18:00 BST on Thursday, with a fee and personal terms agreed within 24 hours.

Chelsea are believed to have agreed to pay £30m to the Russian club.

The transfer was made possible after Chelsea owner Roman Abramovich, whose fellow Russian oligarch Suleyman Kerimov owns Anzhi, intervened.

Willian was expected to join Tottenham, but when the Blues stepped in he felt the chance to play Champions League football was too good to reject.

Sources close to the player said Chelsea have made enquiries or offers for his services in every transfer window since 2011.

Willian will become the Stamford Bridge club's third major summer acquisition following the arrivals of Germany forward Andre Schurrle and Netherlands midfielder Marco van Ginkel.

Jose Mourinho mocks Spurs over Willian medical

On Friday Blues manager Jose Mourinho had indicated that Willian would choose Chelsea over Tottenham.

Willian joined Anzhi in January for a reported £30m after five-and-a-half seasons with Shakhtar Donetsk in Ukraine, but he became available as the Russian club attempt to cut costs after a change in strategy by their owner.

Tottenham had expected to break their transfer record and make Willian their fifth major summer signing.

Willian's arrival at Stamford Bridge further strengthens a squad full of attack-minded midfielders including Eden Hazard, Oscar, Kevin De Bruyne, Schurrle and Juan Mata, who Mourinho insists will not be leaving.