The Spain winger opened his account for the match in the 33rd minute and then, after Barca goalkeeper Victor Valdes had saved a Roberto Trashorras penalty, he made it 2-0 at the start of the second half.
Pedro completed his maiden treble for the club in the 72nd minute with a third successive first-time finish from inside the area, and then Cesc Fabregas wrapped up the scoring with a fourth as the Spanish champions made it five wins from five in the league this season.
The 26-year-old, who had scored 10 doubles for the Catalan giants previously but never a hat-trick, was understandably delighted with his three goals but was keen to share the plaudits around.
He said on his club's website: "I'm very pleased because it was a difficult match and because of my team-mates, it's because of them that I scored the goals I scored.
"I'm happy with how the team worked tonight. We know how difficult Vallecas is, it's a hard place to come to. They have a competitive team, but we managed to find the spaces and score goals."
Pedro was drafted back into Barca's starting line-up for the league match by coach Gerardo Martino having been named on the bench for the midweek Champions League win over Ajax.
Regarding that, Pedro added in AS: "We all want to play, we all want to be in the line-up. Scoring goals is good for the confidence.
"The coach decided to rest me (against Ajax); I'd played games for Spain. I'm ready to play whenever the coach asks me to."