Arturo Vidal spent three successful seasons at Bayern Munich. Photo: Jon Nazca/Reuters

Barcelona have reached agreement with Bayern Munich to sign Chile international midfielder Arturo Vidal, the two European giants announced on Friday night.

The 31-year-old, who has played 100 games for Chile and scored 24 goals, will sign a three-year deal after having a medical in the next few days, Barca said in a statement.

Bayern added: “Arturo Vidal is leaving Bayern Munich with immediate effect to join Spanish Liga champions Barcelona. The clubs reached agreement on the transfer late on Friday evening.”

No transfer fee was given, but Spanish media reports said Barca will pay €18 million, rising to €21m for the former Bayer Leverkusen and Juventus player.

Vidal, who joined Bayern in 2015 from the Turin club, scored 22 goals in 124 appearances in Munich and won the German title three times, the German Cup and two domestic Supercups.

“Thank you to FC Bayern and all the fans,” Vidal said. “I’d like to thank the club for giving me the chance to take on another new challenge with Barcelona.”

Bayern chairman Karl-Heinz Rummenigge added: “...I wish to thank Arturo with all my heart for three fantastic years.

“Arturo made a significant contribution to the great successes we enjoyed in this time. He always led from the front in important matches, and we could always rely on him.”

Vidal also enjoyed success at Juventus where he won four Serie A titles, the Italian Cup and two domestic Supercups after joining the Turin club from Leverkusen in 2011.

He played for Juve against Barca in the 2015 Champions League final, where he was on the losing side in a 3-1 defeat.