BARCELONA — Cristiano Ronaldo helped Real Madrid roll to a 3-1 win over Athletic Bilbao Sunday hours before the Spanish club announced it had signed Gareth Bale to pair him with the Portugal forward in one of the most formidable attacks in football. Not to be overshadowed by Bale's imminent arrival, Barcelona's Lionel Messi needed 41 minutes to score a hat trick at Valencia in a thrilling 3-2 victory for the defending Spanish league champion. Silent just after its match against Bilbao, Madrid later announced Bale was leaving Tottenham and signing a six-year contract, ending the longest transfer saga of the offseason one day before the market closed. It was the third treble before halftime of his career, and 23rd overall, and at 26 he is now the sixth highest scorer in La Liga with 220 goals, surpassing Quini's 219 and closing in on the record of 251 held by Telmo Zarra. Messi started his treble in the 11th when Sergio Busquets intercepted a pass and shuffled the ball to Cesc Fabregas, who then used one touch to send Messi charging into the area and over goalkeeper Diego Alves before rolling the ball home. The sequence of Busquets robbing the ball, Fabregas assisting, and Messi scoring repeated itself in the 39th. Barcelona coach Gerardo Martino had said after Barcelona's 0-0 draw against Atletico Madrid earlier this week that he wanted Messi and Neymar to link up more in attack. Martino got what he had asked for when Neymar picked out Messi arriving down the middle of the area to slice his pass into the net for his league-leading fifth goal in two games after sitting out one match due to a muscle problem. But just when it appeared Barcelona would romp, Valencia striker Helder Postiga used an acrobatic volley to pull one back in the 44th before he scored with a header from a corner kick in first-half injury time. Neymar was involved twice more in almost getting Messi another goal, only to see the Argentine miss both late chances before Valencia substitute Jonas hit the post four minutes from time. Elsewhere, Atletico won 2-1 at Real Sociedad. Atletico, Barcelona, Madrid and Villarreal are the only teams with three wins in as many rounds. Espanyol, meanwhile, remained unbeaten after drawing 0-0 at home with the winless Real Betis, while Malaga drew 2-2 at Sevilla. — Agencies