Argentina captain Roberto Ayala paid six million euros ($8.28 million) to buy himself out of his contract with Villarreal on Tuesday prior to completing a controversial move to Primera Liga rivals Real Zaragoza. Ayala, who captained Argentina in the Copa America, was set to join Villarreal after his contract with Valencia ended in June, but the 34-year-old centre-back shocked the club by deciding to break the agreement and take off for Zaragoza. The defender underwent a medical with Zaragoza on Tuesday and the club said he would be presented to the media later in the day after signing a three-year contract. Zaragoza made the move for Ayala to fill the gap left by his partner in the Argentina defence, Gabriel Milito, who was sold to Barcelona for a fee of up to 20.5 million euros earlier this month. He will join fellow Argentine internationals Pablo Aimar, Diego Milito and Andres D'Alessandro at his new club who have qualified for the UEFA Cup after finishing sixth last season. Ayala began his career with Argentine side Ferro Carril Oeste before joining River Plate in 1993. His performance for the Argentine giants earned him a transfer to Italian side Napoli in 1995 where he remained for three seasons before signing for AC Milan. Ayala joined Valencia in 2000 from AC Milan and became their most influential player in a much-vaunted back four. He played an instrumental role in helping the club to reach the Champions League final in 2001 and was a key player in their league triumphs in 2002 and 2004 as well as their victory in the UEFA Cup in 2004. Argentina's most capped player, Ayala won his 115th cap in the Copa America final on Sunday but scored an own goal in his side's comprehensive 3-0 defeat by Brazil. Ayala also announced his retirement from international soccer on Tuesday, two days after winning his 115th cap during his side's 3-0 defeat to Brazil in the final of the Copa America. 'I took the decision some time ago and it wasn't just because of the result but because I think a cycle has come to an end in the national team,' Ayala told a news conference after signing a three-year contract with Real Zaragoza.