The Argentina star had not scored in his last four matches but netted a hat-trick inside 40 minutes at the Nou Camp as the hosts eased into a 3-0 half-time lead.
Former Middlesbrough forward Martin Braithwaite made his debut after his controversial move from LaLiga strugglers Leganes earlier this week and had a hand in Messi's fourth and Arthur's late goal to put pressure on Real Madrid.
Los Blancos, who were replaced at the top by Barca, fell to a 1-0 defeat at Levante ahead of next week's El Clasico.
Struggling Leganes, who were not allowed to replace top goalscorer Braithwaite, fell to a 1-0 loss at 10-man Celta Vigo.
Filip Bradaric was sent off after just 21 minutes for the hosts but Iago Aspas secured victory in the second half, which saw Celta climb out of the relegation zone.
Real Sociedad moved into the Champions League places after a 3-0 triumph over Valencia, whose winless run extended to five games in all competitions, following goals from Mikel Merino, Nacho Monreal and Adnan Januzaj.
Ronaldo, playing in his 836th club match of his career in addition to 164 games for Portugal, broke the deadlock in the 39th minute when he fired in Juan Cuadrado's low cross.
Milan took the lead through Ante Rebic's deflected effort in the 52nd minute before Dalbert was dismissed on the hour for denying Zlatan Ibrahimovic a goalscoring opportunity.
Rodrigo Palacio scored in the second minute of stoppage time to earn a 1-1 draw for Bologna against Udinese, whose winless run extended to seven matches, despite Stefano Okaka putting them ahead in the first half.
Erling Haaland continued his impressive goalscoring streak for Borussia Dortmund as they inflicted a fifth successive Bundesliga defeat on Werder Bremen.
Dan-Axel Zagadou volleyed home Jadon Sancho's corner in the 52nd minute before Haaland swept in at the near post 14 minutes later for his 12th goal in eight games for Dortmund to complete a 2-0 win.
RB Leipzig sent out a daunting message with a 5-0 drubbing of Champions League-chasing Schalke.
Christopher Nkunku set up four of the goals as Marcel Sabitzer, Timo Werner, Marcel Halstenberg, Angelino and Emil Forsberg helped Leipzig cut the gap to leaders Bayern Munich to one point.
Cologne were winners of the same scoreline at Hertha Berlin, with Jhon Cordoba and Florian Kainz both scoring doubles and Mark Uth rounding off the triumph.
Fortuna Dusseldorf ended a run of five league games without a win to defeat Freiburg 2-0, while Borussia Monchengladbach were held to a 1-1 home draw with Hoffenheim.
Marseille suffered their first Ligue 1 loss since October, losing more ground on leaders Paris St Germain following a surprise 3-1 home reverse to Nantes.
Anthony Limbombe and Morgan Sanson traded first-half goals but a fine Abdoul Kader-Bamba strike and Alvaro own goal sealed the win for Nantes.
A Loic Remy brace and Renato Sanches calm finish helped Lille move up to third in the table with a 3-0 success over rock-bottom Toulouse.
Angers ended a run of four straight league games following a 1-0 victory over Montpellier, with Stephane Bahoken scoring the winner one minute after coming on as a substitute.
Monaco battled back to earn a 1-1 draw at Dijon, who climbed out of the relegation zone on goal difference, while Strasbourg and Amiens played out a goalless draw.