Copa del Rey Wrap: Barcelona arrest slump
Cartagena's fans erupted when they hit the front in the 16th minute as Barcelona head coach Gerardo Martino must have started to wonder whether his team was cursed.
But the visiting Catalans recovered at the Estadio Municipal Cartagonova to score twice in either half and win the first leg of the round-of-16 tie comfortably.
Barcelona entered Friday's clash having lost their previous two games in all competitions (2-1 to Ajax Amsterdam and 1-0 to Athletic Bilbao) and Martino picked a team with two of his previously injured defenders - Carles Puyol and Jordi Alba.
Cartagena striker Fernando took advantage of some rustiness and lack of understanding between Puyol and central defensive partner Marc Bartra just after the quarter-hour mark as he burst between them to collect a long pass and converting calmly past Jose Manuel Pinto.
The visitors were stunned but slowly started to work themselves back into the game and Pedro eventually equalised for the Catalans with a well-taken shot in the 36th minute.
Barcelona led at half-time after Cesc Fabregas volleyed Adriano's cross into the top corner just before the break, while they completed their victory late in the second half as Pedro and Jean-Marie Dongou scored in the final 15 minutes.
In Villarreal, the hosts needed a goal from Javier Aquino in second-half stoppage time to snatch a 2-2 draw against Elche.
Giovani dos Santos opened the scoring for the home team in the 23rd minute but Elche, who sit six spots and 11 points behind Villarreal in La Liga, took control of the game around the hour mark.
After a corner in the 61st minute, the visitors sent the ball back into Villarreal's penalty area and an unmarked Sergio Pelegrin headed home, while five minutes later, more lax marking from the hosts allowed Richmond Boakye to glance his header inside the near post to give Elche the lead.
But in the fourth minute of stoppage time, Aquino collected a loose ball on the edge of the box and fired it past Elche goalkeeper Tono to secure a draw for Villarreal.
In other round-of-16 first leg results, Sevilla survived a 52nd-minute red card to Coke to win 1-0 at Racing Santander, Real Valladolid and Rayo Vallecano played out a 0-0 stalemate, Real Sociedad were pegged back by third-tier Algeciras to draw, while Real Betis triumphed 2-1 over Lleida Esportiu, who had goalkeeper Pau Torres sent off in just the fifth minute.