'Los Cules' faced an uphill battle to defend their undefeated league record against their eternal enemy when Sergi Roberto was sent off just before half-time.
However, Barcelona edged ahead for the second time in the match through their Argentine talisman in the 52nd minute.
Luis Suarez had appeared to foul Raphael Varane down the left after Frenchman's leg from under him. Referee Jose Hernandez was unmoved though allowing Suarez to find Messi in the box.
The forward cut inside before curling beyond Keylor Navas and into the bottom corner to make it 2-1, bringing up his 33rd La Liga goal of the season.