Cordoba, Spain (SportsNetwork.com) - Gareth Bale fired home a last-gasp penalty kick on Saturday as 10-man Real Madrid came away with a difficult 2-1 win over Cordoba at the Estadio Nuevo Arcangel.

Real Madrid entered the match looking for a second successive win after skating past Getafe, 3-0, last time out, but it was Cordoba that grabbed the lead after just two minutes when Sergio Ramos was whistled for a handball in the box and Nabil Ghilas confidently slotted home the ensuing penalty kick.

Despite falling behind early, Los Blancos battled back to equalize in the 27th minute when Karim Benzema fired past Cordoba goalkeeper Juan Carlos.

Things then became more difficult for Real Madrid with eight minutes to play when a moment of madness from Cristiano Ronaldo saw the Portuguese star shown a straight red card as he lashed out at a Cordoba defender and was immediately shown his marching orders by referee Alejandro Hernandez.

The home side then went down to 10 men with three minutes to play thanks to a second yellow card shown to Federico Nicolas Cartabia, and Bale fired home the wining penalty in the final minute of normal time to save Real's blushes and keep the club one point clear of rivals Barcelona at the top of the La Liga table.

The Catalan club was also in action on Saturday and had little trouble with Elche at the Martinez Valero as Lionel Messi and Neymar both scored braces to lead Barca to a 6-0 rout.

Barcelona started the scoring barrage in the 35th minute through an unlikely source as Gerard Pique fired home and Messi converted a penalty 10 minutes into the second half to double the lead.

Neymar then got into the scoring mood in the 69th and 72nd minutes to make it 4-0, while Messi finished his double two minutes from time and Pedro capped the rout with a goal in stoppage time.

Defending La Liga champions Atletico Madrid kept pace with Real and Barcelona on Saturday with a 3-1 win over Rayo Vallecano at the Vicente Calderon.

Antoine Griezmann opened the scoring for the hosts after 12 minutes and completed a double in the 22nd minute for a quick two-goal margin.

Roberto Trashorras pulled one back for Vallecano in the 35th minute, but it was canceled out by an own goal from Manucho as Atletico walked away with all three points to remain in third place with 44 points.

Luciano Dario Vietto scored in the 56th minute to lift Villarreal to a 1-0 win over Levante, while Xabier Prieto's 55th-minute tally handed Real Sociedad a 1-0 victory against Eibar.