Barca played 45 minutes with 10 men but managed to extend their record undefeated streak in the top flight to 42 matches, a record that stretches back to April 2017.
In Andres Iniesta's last Clasico, Luis Suarez gave the Catalan giants an early lead by turning in a terrific right-wing cross from Roberto, but the advantage did not last long as Madrid hit back in the 14th minute.
Cristiano Ronaldo - substituted at half-time due to injury - equalled Alfredo Di Stefano's record of 18 Clasico goals for Madrid by tapping in a clever Karim Benzema header back across goal.
Madrid's chances of winning were boosted by Roberto's red card for appearing to strike Marcelo in the face late in the first half, although Gareth Bale could have also been dismissed after seeming to stamp on the back of Samuel Umtiti's leg.
Although they were a man light, Barca regained the lead thanks to a sensational Lionel Messi goal - his 26th in this fixture - but Madrid felt Suarez fouled Raphael Varane in the build-up.
Bale had the final say by getting his first LaLiga Clasico goal with a 20-yard strike to claim a point for Madrid, who stay 15 points behind their irrepressible rivals.
Suarez missed an early chance after being fed by Messi, but the Uruguay forward put Barca in front in the 10th minute.
Roberto raced away down the right after being sent clear by Suarez, who timed his run to the back post perfectly to turn the deep cross past Keylor Navas with a low volley.
The lead did not even last five minutes, though, Ronaldo inevitably central as he made it 12 goals in his last 12 visits to Camp Nou.
18 - Cristiano Ronaldo has equalled Alfredo Di Stefano as the all-time Real Madrid top-scorer in El Clasico in all competitions. Legends. pic.twitter.com/kXmQezNqZT— OptaJose (@OptaJose) May 6, 2018
Ronaldo started the move by teeing up Toni Kroos on the overlap, the Germany midfielder's cross nodded into the middle by Benzema and the Portugal superstar tapped in on the line despite the close attention of Gerard Pique.
Madrid were stamping their authority on the contest, Ronaldo heading over and drilling wide either side of being denied at close range by Marc-Andre ter Stegen.
The first half ended with referee Alejandro Jose Hernandez Hernandez in the thick of the action, Suarez and Sergio Ramos booked before Messi earned a yellow for a late foul on the Madrid captain.
Tempers boiled over before the break as Roberto saw red for lashing out at Marcelo, the Barca full-back seeming to push his hand into his opponent's face.
Ronaldo, who appeared to be injured in the process of scoring, was replaced by Marco Asensio at half-time, while Nelson Semedo plugged the gap left by Roberto by coming on for Philippe Coutinho.
Madrid were leaving too many gaps, though, and Barca went back in front in the 52nd minute thanks to Messi's first home league Clasico goal in five matches.
Suarez seemed to trip Varane as he robbed the defender wide on the left, but the referee waved play on and he passed for Messi to cut inside two challenges and smash a shot into the bottom-left corner.
Barca thought they had extended their lead through Suarez, only for the goal to be disallowed for a marginal offside in the build-up, and Iniesta, seemingly set for a switch to the Chinese Super League, was then withdrawn to a standing ovation.
Navas did well to stop Messi wrapping up the points after the Barca star raced clear and that save proved key as Bale struck in the 72nd minute.
Madrid felt Jordi Alba brought Marcelo down in the box but the referee waved away the appeals, before Messi missed two late openings as the last Clasico of the season ended with the spoils shared.
Key Opta stats:
- With their first goal, Real Madrid became the first team in El Clasico history to score 400 goals in all competitions (Barcelona have 389).
- Lionel Messi has now scored more LaLiga goals at the Camp Nou than any other player in El Clasico history with seven.
- Cristiano Ronaldo equalled Alfredo Di Stefano as the all-time Real Madrid top-scorer in El Clasico in all competitions (18 apiece).
- Zinedine Zidane (W2 D2) equalled Miguel Munoz (W4 between 1962 and 1965) as the Real Madrid coach with the longest unbeaten run against Barcelona away from home in all competitions.
- Barcelona have failed to win in their last four home games against Real Madrid in all competitions (D2 L2), their worst run at home in El Clasico since December 2003 (D2 L2).
- Luis Suarez has scored six goals in his eight LaLiga games against Real Madrid, more than any other player since his debut in the competition in 2014-15.
- Gareth Bale scored his second goal in El Clasico after the 2014 Copa del Rey final and his first in LaLiga.
- Karim Benzema is the first Real Madrid player to hit double figures for both goals (11) and assists (10) this season in all competitions.
- Luis Suarez has assisted Lionel Messi for seven goals in LaLiga this season, more than any other player to another.
- Keylor Navas has conceded 23 LaLiga goals against Barcelona, at least 12 more than against any other side in the competition (Real Betis, 11).
- Sergi Roberto is the first Barcelona player to be sent off in El Clasico since Victor Valdes in March 2013 in LaLiga and the first one at the Camp Nou since David Villa in August 2011 in the Supercopa de Espana.
- Barcelona attempted 11 shots against Real Madrid, only four more than Cristiano Ronaldo in his 45 minutes.