Real Madrid and Barcelona line up ahead of "El Clasico", one of the most fiercely-contested matches in world football.

Barca enjoyed a dream start, with Lionel Messi teeing up Andres Iniesta, who fired his shot high into the net past Real goalkeeper Diego Lopez with just seven minutes on the clock.

Real's response was emphatic. Winger Angel di Maria and striker Karim Benzema twice combining to turn the match on its head. First, Di Maria crossed for Benzema to plant a firm header beyond Victor Valdes (pictured). Moments later the duo did it again, Benzema taking one touch before volleying beyond Valdes following another fine cross from Argentina's Di Maria.

Real were on top but Barca fought back, four-time FIFA Ballon d'Or winner Messi shooting low past Lopez to level the score at 2-2 just before half time.

In the second half, Real were awarded a penalty when Dani Alves was adjudged to have tripped Cristiano Ronaldo, although the foul looked to have been committed outside of the box. Ronaldo stepped up to confidently convert the penalty and restore Real's lead.

Barca bounced back once again. Real defender Sergio Ramos was sent off for bringing down Neymar, the 19th red card of his career, and Barca had a penalty of their own. Messi was on hand from the spot to level the match at 3-3.

With Real down to 10 men, Barca took control. Xabi Alonso fouled Iniesta and Barca were awarded another penalty, the third of this pulsating contest. Messi scored once again to complete his hat-trick, the 26th treble of his career. It was enough to seal a 4-3 win for Barca.

(CNN) -- Barcelona manager Gerardo Martino said prior to Sunday's El Clasico that it was his team's last chance in the Spanish title race.

His side came through against Real Madrid -- and it was a familiar face who led the way.

Lionel Messi netted a hat-trick to become the leading scorer in El Clasico history as part of a 4-3 Barcelona victory that featured just about everything in Madrid. The estimated worldwide television audience of 400 million for arguably football's biggest club game couldn't have been disappointed.

"(Messi has) put in many performances like the one he put in today, but the impact is greater in a Clasico," Martino was quoted as saying on Barcelona's website. "I really have run out of words for him."

The first half alone produced four goals but it could have been six or seven. The referee was in the spotlight for awarding three penalties, two to Barcelona, and what would an El Clasico be without a red card?

It went to Real Madrid's Sergio Ramos midway in the second half with the home team leading 3-2 and predictably changed the complexion of the affair.

Out went Real Madrid's 31-game unbeaten streak, a run that began following Barcelona's win in this season's first league meeting between the giants in October.

But a part of Madrid won't be disappointed with the result, since Atletico Madrid assumed top spot in La Liga ahead of its city rival thanks to a better head-to-head record. Barcelona trails by a point.

"La Liga has started over, we're back in the fight for the title," added Martino.

The early moments of Sunday's showdown suggested it would be an open contest and so it wasn't much of a surprise that it took a mere seven minutes to produce a goal.

Messi's ball released Andres Iniesta, who shot into the top corner.

Karim Benzema should have quickly leveled but his effort sailed over the bar and four-time world player of the year Messi was guilty of a rare bad miss himself, scuffing his shot when in alone.

Angel di Maria outshone his fellow winger Gareth Bale, his first-half display scintillating. Messi's fellow Argentine set up Benzema's header in the 20th minute for 1-1 -- although keeper Victor Valdes' reaction suggested he knew he made a mistake.

With Barcelona reeling, Benzema's close-range finish in the 24th minute handed Madrid the advantage and the French international was only denied a hat-trick when Gerard Pique cleared off the line.

Messi tied proceedings in the 42nd minute to break Alfredo di Stefano's El Clasico record, with Barcelona midfielder Cesc Fabregas and Real Madrid defender Pepe shown yellow cards in the aftermath when they touched heads -- and then theatrically fell to the ground.

Bale -- the world's most expensive player who entered the game in his best form of the campaign -- ran at the Barcelona defense to set up Benzema, who was deprived by Valdes to begin the second half.

Cue the controversy.

Referee Alberto Undiano Mallenco awarded Real Madrid a penalty when Dani Alves clipped Ronaldo but contact appeared to be outside the box. Ronaldo, who like Bale was mostly quiet Sunday, took the spot kick and the reigning world player of the year converted in the 55th minute.

Cristiano Ronaldo wins 2013 Ballon d'Or

Gerard Pique: Shakira is on my iPod

Lionel Messi breaks goal scoring record

Messi sent through Neymar and the Brazilian -- about to be substituted after struggling -- was ruled to have been fouled in the box by Ramos. Undiano Mallenco again pointed to the spot, Ramos as the last man received the 19th red card of his career and Messi leveled in the 65th to make yet more history. He became the second leading scorer in La Liga on 236 goals.

With Real Madrid forced to sit back and defend, the breakneck pace predictably slowed.

Alves hit the post but when Iniesta went down under a challenge from Xabi Alonso, Undiano Mallenco awarded the third penalty.

Up stepped Messi in the 83rd minute. He showed no nerves, sending his kick into the roof of the net for a 26th career hat-trick and second in as many games.

"We had chances and we are not happy, but not to worry, the league is still open," Real Madrid manager Carlo Ancelotti told reporters.

Atletico earlier Sunday downed last-place Real Betis 2-0.

A dogged Betis frustrated Atletico for the opening 55 minutes but when Braian Rodriguez was sent off for a second yellow, the visitor pounced.

Gabi -- with a long-range stunner -- and Diego Costa scored in the 58th and 64th minutes, respectively, to give Atletico the win and ultimately first place in Spain.