The Argentine was the star of the show once again as Pep Guardiola's men swept away the challenge of the visitors.
Carles Puyol netted the opener early on as the Catalans got off to a flying start to the match. The Blaugrana captain soon turned from hero to villain, though, as he allowed Salomon Rondon to find the equaliser with a fine header shortly after.
Messi, however, had the final say as he netted a debatable penalty just after the half-hour mark, and added a double in the second period to round off an important win for Barcelona.
Both teams began the match cautiously, but it was Malaga which looked the more threatening side in the opening minutes. Duda struck the post for Manuel Pellegrini's men with a free kick as the visitors were starting to build momentum, but they were soon pegged back by a trademark Barcelona goal.
Messi and Andres Iniesta combined well on the right, before the Spaniard crossed for captain Puyol, who applied a simple finish, leaving Carlos Kameni helpless. Malaga, however, was not too discouraged by the turn of events and continued to apply pressure on the hosts.
Just before the half-hour mark Malaga's effort was rewarded as Rondon netted the equalizer in a seemingly harmless situation. An opportunistic cross by Jesus Gamez from the right found the Venezuelan in the box, and the striker scored with a diving header after slipping past Puyol.
Malaga's joy did not last long, however, as in the 34th minute Barcelona was handed a penalty for a foul on Iniesta. Messi kept his nerves, and coolly converted in the centre of Kameni's goal to restore Barcelona's lead.
Malaga tried to get back into the game after the break, but its hopes were soon crushed by Pep Guardiola's clinical team, and in particular, its Argentine star.
On the hour mark a mistimed challenge by Duda on Messi in the box resulted in a penalty for the Blaugrana. The Ballon d'Or holder once again got the better of goalkeeper Kameni from the spot as he equaled Gerd Muller's record for most goals in one European season.
The Argentine did not stop there, however, as in the 64th minute he completed his hat trick. A clever through-ball by Iniesta saw Messi rush through Malaga's defense and flick the ball over Kameni to make it 4-1 for Barcelona.
Manuel Pellegrini's men never give up, however, and tried to take the game to the Catalans in the remaining minutes of the match. Their efforts were futile, however, as Pep Guardiola's men easily soaked the pressure to record a convincing victory.