Cristiano Ronaldo scored two goals in Real Madrid's 3-1 win at Villarreal for the Portugal forward to match the Spanish league's single-season goalscoring record of 38, while Getafe and Zaragoza both won to ensure the final relegation spot will be decided in the last round.

Ronaldo curled a pair of free kicks past goalkeeper Diego Lopez in the 22nd and 93rd minutes respectively, to match the mark set by Athletic Bilbao's Telmo Zarra and Madrid's Hugo Sanchez, the league scoring leaders from the 1950-51 and 1989-90 seasons.

Ronaldo can set the new mark in the season's final game at the Santiago Bernabeu.

''We've got one game left against Almeria but I'm not obsessing about it,'' Ronaldo said. ''I never expected to score so many goals. It's an honor to sit alongside football greats.''

Barcelona celebrated its third straight domestic title after a lackluster 0-0 draw against Deportivo La Coruna, as the Catalan club paraded its 21st league trophy around the Camp Nou in front of 70,044 spectators.

''We beat the world's richest and most powerful team and with three rounds left. There's a lot of merit in that,'' Barcelona coach Pep Guardiola said of the league title. ''Next season will be even more difficult.''

Villarreal's defeat means Valencia secured third and an automatic place in next season's Champions League despite a 0-0 draw against 10-man Levante, which ensured its place in the topflight alongside Malaga, Sporting Gijon and Racing Santander.

Athletic Bilbao, Atletico Madrid and Sevilla all clinched spots in next season's Europa League while Espanyol missed out following a 1-0 defeat at Zaragoza.

Despite Leonardo Ponzio's 55th-minute winner, Zaragoza remains in 18th and the final relegation spot with 42 points as six teams go into the 38th round facing the possibility of the drop. Mallorca, Real Sociedad and Osasuna all have 44 points, Deportivo has 43, Getafe 42 and Zaragoza 42.

Hercules and Almeria have already been relegated, with second division leader Real Betis assuring its spot in the first division on Sunday.

Marcelo's 17th-minute chip of Lopez put Madrid ahead at El Madrigal, where Cani's 51st-minute effort brought Villarreal back into it.

But Ronaldo's ninth goal in three games took his season tally to 51 - just one shy of Barcelona counterpart Lionel Messi's season total. The pair of internationals are the first Spanish league players to top 50 goals in a season.

''It may be my best season in terms of goals. I'm much happier on an individual level than a team level as we hoped to win the league and the Champions League,'' Ronaldo said.

Spanish newspaper Marca, which awards the Pichichi trophy for the season's top scorer, still had Ronaldo at 39 goals although that extra score from a 2-1 win at Real Sociedad earlier this season was given to Pepe in the referee's match report.

Deportivo had the better chances, with Messi missing from Barcelona's starting lineup as coach Pep Guardiola rested his regulars ahead of the Champions League final against Manchester United on May 28 at Wembley.

Athletic Bilbao and Malaga drew 1-1, while Almeria beat Mallorca 3-1 to keep it out of danger of the drop as did Sporting Gijon with a 2-1 win over Santander.

Miguel Flano pushed Daniel Parejo's cross into his own goal in the 65th before Pedro Rios confirmed Getafe's 2-0 win over Osasuna in injury time with the second goal. Getafe goalkeeper Oscar Ustari tipped Walter Pandiani's header onto the bar in the 84th to ensure the win.

Frederic Kanoute scored two goals in his last game at the Sanchez Pizjuan stadium as Sevilla beat Sociedad 3-1.

Meanwhile, Jose Antonio Reyes volleyed a hard shot home for the 71st-minute winner for Atletico to beat Hercules 2-1 and ensure at least seventh place and the final European spot. Copa del Rey champion Real Madrid is already assured of a Champions League place thanks to its second-place finish, which leaves an extra place available to Spanish teams in Europe's second-tier competition.