MADRID — Another late goal for Barcelona, another disappointing draw for Atletico Madrid.

For the second consecutive year, Atletico wasn't able to hold on to its lead against Barcelona at Wanda Metropolitano Stadium, missing another chance to end its winless streak against the Catalan club in the Spanish league.

Ousmane Dembele's 90th-minute goal gave Barcelona a 1-1 draw in Madrid on Saturday, extending its unbeaten run against Atletico to 17 leagues matches.

Diego Costa put Atletico ahead in the 77th with his first league goal of the season.

Last year, it was an 82nd-minute equalizer by Luis Suarez that denied Atletico.

"We let it slip away," Atletico coach Diego Simeone said. "Details made the difference."

Atletico hasn't beaten Barcelona in the league since 2010, before Simeone took charge. It has only two wins against the Catalan club in 27 matches, both in the Champions League.

The result kept Barcelona one point in front of Atletico at the top of the league, with Sevilla having a chance to move past both teams with a home win against Valladolid on Sunday.

"Atletico is definitely a rival for us in the title race," Barcelona coach Ernesto Valverde said. "It was important to salvage a draw."

Neither team created significant scoring chances until Costa's close-range header on a corner taken by Antoine Griezmann.

Dembele's equalizer came from a low left-footed shot past goalkeeper Jan Oblak after a pass by Lionel Messi.

Real Madrid dropped five points behind Barcelona after its perfect run under coach Santiago Solari came to an end with a shock 3-0 defeat at Eibar.

MADRID'S SETBACK

Real Madrid struggled on both sides of the field, never getting close to victory in its visit to Eibar.

The attack was inefficient and defensive mistakes proved costly for Solari's team as it lost to the Basque Country club for the first time.

In his first match since being given the permanent coaching job, Solari was trying to win his fifth straight match since replacing the fired Julen Lopetegui.

Gonzalo Escalante, Sergi Enrich and Kike Garcia scored at Ipurua Stadium.

"Eibar played with real heart and that was clear for all to see," Solari said. "They played extremely well and we couldn't match them. We have to congratulate them on a quality, complete performance."

Defeat left Madrid with one of the league's worst defences, 19 goals conceded. Only four teams have conceded more.

Barcelona also has conceded 19 goals after 13 matches.

VALENCIA'S RUN

Valencia easily defeated relegation-threatened Rayo Vallecano 3-0 for its fourth win in its last five matches in all competitions.

Santi Mina scored twice and Kevin Gameiro once for the hosts, which had won only once in their first 13 games.

The good run moved Valencia to ninth in the standings, safely away from the relegation zone.

Rayo Vallecano, second-to-last in the standings and winless since its third match of the season, played the final minutes with 10 men after Luis Advincula was shown his second yellow card.

HUESCA STAYS LAST

Huesca drew with Levante 2-2, staying in last place and extending its winless streak to 12 matches.

Playing in the first division for the first time, Huesca hasn't won since the first round.

___

More AP soccer: https://apnews.com/apf-Soccer and https://twitter.com/AP_Sports

___

Tales Azzoni on Twitter: http://twitter.com/tazzoni