Barcelona retained the Spanish league title Sunday, crushing Valladolid 4-0 at Camp Nou stadium in its final game of the season to win the championship for a 20th time. Lionel Messi scored twice in the second half, following Luis Prieto's own goal and a strike from Pedro Rodriguez before halftime. Barcelona finished its campaign with a record Spanish league tally of 99 points from 38 games, with coach Pep Guardiola celebrating the second league title in his two seasons in charge. Messi's goals took his league tally to 34 this season, equaling the club record set by Brazil's Ronaldo in 1996-97. Real Madrid drew 1-1 at Malaga to finish three points behind Barcelona. It is the second straight season that Madrid has failed to win a major trophy despite spending more than $309 million on players. Valladolid's defeat meant it was relegated into the second division, along with Tenerife and Xerez. Valladolid, led by former Spain coach Javier Clemente for the past month, made a bright start against a Barcelona side missing suspended playmaker Xavi Hernandez. The home team then took control, coming close to taking the lead on several occasions before Valladolid defender Prieto inadvertently turned Pedro's low cross past his goalkeeper Jacobo Sanz in the 27th minute. Barcelona doubled its lead four minutes later when Pedro fired his 12th goal of the season following a trademark burst by Messi. The Argentina forward turned the ball home from close range for Barcelona's third goal in the 62nd after Yaya Toure beat two defenders in a charge into the area and fired a center across the face of the goal. Messi doubled his tally 14 minutes later to crown a brilliant season, again receiving a pass from Toure before jinking past two defenders and slotting the ball home. The match marked a happy finale for Barcelona president Joan Laporta, whose term of office is about to end. The club is holding elections on June 13. Madrid made a dismal start when Sergio “Duda” Barbosa sent a half-hit shot past goalkeeper Iker Casillas after playing a one-two with Felipe Caicedo in the ninth minute. The visitor equalized in the 48th when Rafael van der Vaart, receiving Marcelo's pass, wriggled to escape the attention of Malaga defenders before shooting home. Madrid's disappointing final game may have been the last in charge for its Chilean coach Manuel Pellegrini, who hinted Saturday that he may be sacked in the near future. Tenerife finished 18th with 37 points, one more than Valladolid. Xerez was last with 34. Antonito Ramiro's 60th-minute equalizer in the 1-1 draw at Osasuna could not save Xerez. Racing Santander avoided relegation by beating Sporting Gijon 2-0.