MADRID — Barcelona scored its 6,000th goal in the Spanish league after another ingenious strike by Lionel Messi got its title defence off to a winning start.

Messi cleverly sent his free kick underneath Alaves' wall to open the scoring in the 64th minute of Barcelona's 3-0 win at Camp Nou Stadium on Saturday. He also closed the scoring in injury time after substitute Philippe Coutinho had added to the lead in the 83rd.

Messi's low free kick fooled Alaves' players, who jumped to intercept an expected high shot. Goalkeeper Fernando Pacheco couldn't get to the ball in time after it suddenly appeared underneath the barrier.

"Messi never fails to surprise you," Barcelona coach Ernesto Valverde said.

Messi, the league's top scorer last season, had struck the crossbar with a free kick — this time over the wall — in the first half. He also hit the post from inside the area a few minutes after his opening goal.

Messi also scored Barcelona's 5,000th league goal back in 2009, and the Argentine provided 338 of the goals taking the total from 5,000 to 6,000.

Barcelona's first-ever league goal was scored by Manuel Parera against Racing Santander on Feb. 12, 1929.

Barcelona opened its league campaign with a win for the 10thstraight season.

Messi's second goal came in the second minute of injury time, an easy shot from close range after a breakaway.

Barcelona had missed chance after chance in its league debut at Camp Nou, which was far from packed with around 52,000 fans for the 10:15 p.m. start local time.

Ousmane Dembele, who started up front with Messi and Luis Suarez, squandered a series of chances, including a one-on-one with goalkeeper Pacheco in the first half.

Valverde brought Coutinho off the bench in the second half and the Brazil playmaker added the team's second goal after a nice play that culminated with an easy strike from inside the area.

Alaves had stunned Barcelona at Camp Nou in 2016, winning 2-1.

FRUSTRATING START

Villarreal entered the new season with high hopes after a solid fifth-place finish in 2017-18, but its disappointing home opener dampened fans' expectations.

Villarreal couldn't hold on to an early lead at its Ceramica Stadium, losing 2-1 to Real Sociedad.

Gerard Moreno, Villarreal's biggest off-season signing, put the hosts ahead in the 16th before Sociedad came back with goals by Willian Jose in the 40th and Juanmi in the 71st.

Villarreal just missed a Champions League berth last season, finishing behind Valencia, Real Madrid, Atletico Madrid and Barcelona.

DISAPPOINTING DEBUTS

Celta Vigo and Espanyol gave their new coaches a frustrating start in the Spanish league with a 1-1 draw.

Celta began its campaign in Vigo with Argentine coach Antonio Mohamed, and Espanyol kicked off its season with newcomer Joan Francesc Ferrer "Rubi."

The clubs hired new managers after disappointing campaigns last season, when Espanyol finished 11th and Celta was only 13th, far from qualification for the European competitions.

Mario Hermoso put Espanyol ahead at Balaidos Stadium with a shot from inside the area after a corner just before halftime.

Celta equalized early in the second half with an own-goal by David Lopez, who tried to intercept a cross and ended up redirecting the ball into his own net.

SUNDAY'S GAMES

Real Madrid hosts Getafe in a Madrid derby on Sunday, when it's also Eibar vs. Huesca and Rayo Vallecano against Sevilla.

Atletico Madrid — last season's runner-up — visits Valencia on Monday.

___

More AP Spanish soccer coverage: https://apnews.com/tag/LaLiga