(CNN) -- Cristiano Ronaldo scored twice to break the record for goals in a La Liga season as Real Madrid routed Almeria 8-1 in the Bernabeu Saturday night.
Ronaldo's goals in each half took him to 40 for the season, two clear of the previous record set by Athletic Bilbao's Telmo Zarra in 1951 and matched by Real Madrid's Mexican star Hugo Sanchez in 1990.
The Portuguese ace notched the record breaking number 39 after just four minutes and slammed home his second in the 76th.
On-loan Emmanuel Adebayor grabbed a hat-trick and Karim Benzema scored twice, the second set up by an exquisite backheel from Ronaldo, as Real turned on the style for their fans in their final game.
Joselu rounded off the scoring three minutes from time against already relegated Almeria.
Former Manchester United star Ronaldo will win the Pichichi crown, the award given for the league's top-scorer, the first Real Madrid player to claim the honor since Dutchman Ruud van Nistelrooy won it in 2007.
"I would like to thank my team-mates for helping me get these 40 goals,"
"The season didn't go as we wanted but the coach wanted a lot of goals from us to start the next campaign full of hope," he told AFP.
Earlier, three-time title winners Barcelona warmed up for their Champions League final against Manchester United with a 3-1 win at Malaga.
Barcelona coach Pep Guardiola rested several of his star players, including Lionel Messi, ahead of next Saturday's game at Wembley.
Malaga, who had won five of their last six league games, took a 31st-minute lead through Uruguay's Seba Fernandez.
But Barcelona's mix of youngsters and fringe players equalized in the 43rd minute through a Bojan Krkic penalty.
Dutch signing Ibrahim Afellay and Bartra scored their first league goals for Barca in the second half to seal the victory.
They have finished the the season with 96 points, three less than last season, having won 30 out of their 38 games.
They finished four points clear of arch-rivals Real, who they also beat in the semifinals of the Champions League.