Messi's total now stands at 68 goals in all competitions, one more than the 67 Muller managed for Bayern Munich in the 1972-3 season.
The Argentine's first goal, a penalty, equalled Pele's Santos record of 66 set in 1958 before another spot kick drew him level with Muller. Messi finally broke the record in the 64th minute with Barcelona's fourth of the game.
The third goal was also Messi's 46th league goal of the season, making him the highest-scoring player in a single league season in any of the top five European divisions since Tom Waring netted 49 times for Aston Villa in the 1930-1931 season.
The hat-trick goal also brought up a hat-trick of records, as Messi equalled Cristiano Ronaldo's tally of seven hat-tricks in a single season, also set this year.