Atletico Madrid have won the race to sign David Villa from Barcelona after both clubs confirmed an agreement has been reached in principle for the transfer of Spain's record goalscorer to the Rojiblancos.

Villa has been linked with a host of clubs over the past few months, including Arsenal, Tottenham Hotspur and Liverpool from the Barclays Premier League, after struggling to hold down a starting place at Barcelona last season after suffering a broken leg during the Club World Cup in December 2011, which forced him to miss the second half of the 2011/12 season for Barca and also Spain's successful Euro 2012 campaign.

Atletico earned a reported £50m from the sale of striker Radamel Falcao to Monaco but will only be investing a fraction of that on Villa after agreeing a deal worth a maximum of just €5.1m (£4.4m) with Barca for the forward, with the Catalan club receiving 50% of any future transfer fee.

Barca announced in a statement on their website: "Barca and the Madrid club have reached an agreement in principle for the transfer of the Asturian player.

"The deal will cost a maximum of €5.1m, with €2.1m this season, €2m more if the player is still at Atletico Madrid in the 2014/15 season and another €1m if he stays until the 2015/16 season. As well as that, Barca have reserved 50% of the rights of any future transfer of the player."

The announcement comes just weeks after Barcelona completed the signing of Brazil forward Neymar in a €57m transfer from Santos, bolstering an attack that also includes Lionel Messi, Pedro Rodriguez and Alexis Sanchez.