Lionel Messi scored a hat-trick as Barcelona kept Real Madrid waiting for the La Liga title just a little bit longer.
Visiting Malaga almost took a surprise lead in the 12th minute when Duda curled a 25-yard free kick that looked destined for the net, only to smack the face of Jose Manuel Pinto's post.
Barca soon had the lead, however, as Lionel Messi crafted a short-corner set piece that was poked home by Carles Puyol.
The visitors levelled proceedings 10 minutes later when Jose Rondon managed to get in a header despite the attentions of multiple Barca defenders.
The home side regained their advantage with 10 minutes of the opening period remaining when Andres Iniesta was felled in the area, with Messi scoring his 66th goal of the season from the spot.
The little Argentinian scored Barca's third again from the spot after he was brought down by Duda, a goal that equalled Gerd Muller's all-time record for goals in a season from 1972-73.
He went on to break the famous German's record with a hat-trick goal in the 65th minute after being laid in by Iniesta.
The win sees Barca cut the gap to Madrid to four points, although victory for Jose Mourinho's men in Bilbao this evening would see them clinch the La Liga crown.