Barcelona was held by Real Sociedad to a 2-2 draw on Saturday, giving Real Madrid a chance to take the outright lead in the Spanish league before next week's “clásico” between the rivals.
Real Madrid can enter Wednesday's match at Camp Nou Stadium with a two-point lead over Barcelona if it beats Valencia on Sunday.
Spanish powerhouses Madrid and Barcelona will meet for the first time this season in a match postponed from October because of a separatist rally in the Catalan capital.
Barcelona coach Ernesto Valverde didn't rest any of his top players, using Lionel Messi, Luis Suárez and Antoine Griezmann in the attack.
Barcelona, which had won nine of its last 10 league games, was outplayed during most of the match at Reale Arena, with fourth-place Sociedad creating most of the scoring chances and restraining Barcelona.
Mikel Oyarzabal opened the scoring for the hosts by converting a 12th-minute penalty kick after Barcelona midfielder Sergio Busquets was caught grabbing Real Sociedad defender Diego Llorente inside the area.
Barcelona recovered with two fast breakaways, one late in the first half and another soon after the break.
Griezmann equalized in the 38th by flicking the ball past goalkeeper Álex Remiro from inside the area. Griezmann, who played nine seasons with Real Sociedad, didn't celebrate his goal.
Suárez put the visitors ahead in the 49th with a strike into the open net after a pass by Messi, who attracted the defenders before making the assist.
The hosts equalized in the 62nd with a close-range shot by striker Alexander Isak after Barcelona goalkeeper Marc-André ter Stegen couldn't fully clear a cross.
Barcelona wanted a penalty kick when Gerard Piqué was pulled down in stoppage time, but the referee — and video review — didn't give the penalty.
Oyarzabal had also scored the last time Real Sociedad beat Barcelona, in a league match back in 2016.
Barcelona had won seven straight matches against Real Sociedad in all competitions.
Real Sociedad has won only one of its last five league matches. It had lost its last five league games against Barcelona.
LEVANTE REBOUNDS
A late winner by North Macedonia midfielder Enis Bardhi gave Levante a 2-1 win at Granada, ending the team's two-game losing streak.
Bardhi scored with a shot from outside the area in the 89th minute.
Rubén Rochina had put Levante ahead in the 55th, with Darwin Machís equalizing for the hosts five minutes later.
Levante moved to 11th, one point behind ninth-place Granada.