The Argentine made it 2-0 when he netted for the Liga leaders at Camp Nou, extending his record as the highest scorer in the Spanish top flight's history.
Incredibly, Messi only took 435 games to get to his 400th goal, scoring an average of 0.92 goals per game.
His record looks set to stand for many years to come, as Aritz Aduriz is the next top scorer to be currently playing in La Liga with 157 goals in 422 games.
The strike makes Messi the second player to have scored 400 goals in any of Europe's top five leagues, reaching the milestone in 63 games fewer than Cristiano Ronaldo did, and he has now nearly doubled Alan Shearer's Premier League record of 260 strikes.
The 31-year-old's first goal came back in 2005 against Albacete when he was just 17 years of age and was assisted by Barca and Brazil legend Ronaldinho, who scored 70 league goals for the Catalan club in 145 appearances.
Among his 400 finishes have been 83 braces and 31 hat-tricks, helping to put him 89 goals ahead of the league's second top-scorer Ronaldo.
Next on the list is Telmo Zarra, who played for Athletic Bilbao from 1940 to 1955, with 251 efforts. He is followed by Mexican Hugo Sanchez with 234 and Real Madrid legend Raul with 228.
Messi's dominance has not been confined to the league though, and in all competitions he has scored 575 goals.
That gives him a colossal lead over Luis Suarez, who is the second-highest active scorer for Barca with 166 tallies.