Barcelona came into the encounter fresh off a 4-3 aggregate defeat to Eintracht Frankfurt in the Europa League on Thursday.
But the Xavi’s side has been in excellent form in the Laliga, going undefeated in their past 15 games (W11 D4) and winning their last seven.
Cadiz, on the other hand, were looking to move out of the relegation zone after losing just two of their last eight league games (W2 D4), one of which came against Real Betis last time out.
The game stayed goalless at halftime after a tense first half with the hosts having the majority of possession and a couple of good chances.
But, three minutes into the second half, Alex sent a lovely cross to the outside of the six-yard box, where Sobrino flicked on a header and Ter Stegen was perfectly placed to block it.
Sobrino attempted again, but the keeper pushed it away, but Lucas Pérez was on hand to tap it into the empty net from close range, giving Cadiz the lead.
Barcelona squandered the opportunity of grabbing three points, as a win today would have reduced Real Madrid’s lead over them to 12 points.
Cadiz has climbed out of the relegation zone and into 16th place, two points clear of Mallorca and Granada, whom they have overtaken, with Athletic Bilbao their next opponents.
Barcelona’s league winning streak comes to an end, as they are now 15 points behind Real Madrid in second place. They play Real Sociedad on Thursday.
With the hard-fought 1-0 victory over Barcelona, Cadiz boosts their prospects of surviving.