A much-changed Barca side without the suspended Neymar plus the injured trio of Xavi Hernandez, Lionel Messi and goalkeeper Victor Valdes conceded twice in the opening quarter of an hour, Sergio Escudero breaking the deadlock and then Lisandro Lopez scoring a header.
But Pedro's stunning burst of scoring was followed by a volley and a penalty from Cesc Fabregas in the second half - with Pedro getting an assist and then winning the spot-kick to crown a brilliant individual performance.
Anything other than a victory for the visitors would have meant Atletico Madrid were top at Christmas but the win means Barcelona stay at the league's summit for the 53rd consecutive game week.
However, with four members of their usual starting 11 absent, Barca made a nervous start to the game, with Pinto forced to make a save with just two minutes gone. Gerard Pique had the visitors' first attempt on goal, a tame shot which was comfortable for Miguel Angel Moya to save.
Although Barca controlled possession, Getafe had them on the back foot moments before the opening goal arrived.
In the 10th minute Angel Lafita released Escudero down the left hand side of the area with a smart back-heel and the full-back was left alone to beat Pinto, and the ball brushed off the goalkeeper before trickling into the near corner.
Barca failed to react to going behind and soon conceded another goal, Lisandro Lopez rising unchallenged to head home a cross from Pedro Leon.
The Catalans then sprang into life. Pedro was unfairly ruled offside and prevented from pulling a goal back, but the Canary Islander would not have to wait much longer before scoring.
Fabregas played him in through the middle and the forward beat the offside trap and needed just one touch to control the ball before chipping Moya, and although the goalkeeper got a hand to the shot, he was unable to stop it from going in.
Two minutes later, Pedro hit the equaliser. Andre Iniesta picked him out on the opposite side of the pitch and the 26-year-old controlled the ball down the left hand side before cutting inside onto his right foot and sending it into the opposite corner.
But the Catalans were not content to go into the break just level, and Pedro was not about to settle for just a brace either. No sooner had Getafe restarted the game and they were defending another Barca attack. Jordi Alba crossed from the left hand side, a Getafe defender made a hash of the clearance and Pedro was in the right place to gobble up the loose ball and put it back into the net from a couple of yards out.
Diego Castro should have equalised for the Madrid side on the hour mark, but pulled his shot several inches wide of the far post after turning a defender in the area, and eight minutes later Fabregas killed off all hope of a Getafe revival, volleying in a cross from Pedro around the six yard box.
But there was still time for another goal. Pedro was tripped by Borja Gomez in the area and Fabregas slotted home the penalty to grab his second of the night.