Copa del Rey Wrap: Messi returns as Barca win
Messi - who had not played for Barca since limping off in the first half of a 4-1 La Liga win against Real Betis on November 10 - was introduced in the 64th minute for Andres Iniesta in the round of 16 clash.
And he marked his comeback with two goals, making him likely to start for the Catalan giants in their La Liga blockbuster at Atletico Madrid on Saturday.
Fabregas nodded Barcelona into the lead in the ninth minute at Camp Nou, thanks to an excellent cross from Pedro.
His ball in from the left was met powerfully by the former Arsenal captain, who headed back across goal and left Getafe goalkeeper Jordi Codina with no chance.
Fabregas then sealed the victory in the 63rd minute, scoring from the penalty spot on this occasion.
Again the in-form Pedro was involved, with the 26-year-old hauled down in the area, and Fabregas powered his spot-kick into the top left corner.
Diego Castro went close for Getafe in the final 15 minutes, but saw his curling effort go just wide.
And despite the absence of forward Neymar, who was sidelined with gastroenteritis, Messi bagged two late goals - first converting from close range before a long run was followed with a typically composed left-foot finish.
The second leg between the two sides will be played on January 16.
Other scores in the first leg of the round-of-16 matches on Wednesday saw La Liga strugglers Real Betis defeat Athletic Bilbao 1-0.
Ruben Castro scored the game's only goal with a firm header, as the bottom-placed Betis won for the first time since December 6.
Second-tier Alcorcon beat Espanyol 1-0 thanks to Dani Pacheco's late goal and Racing Santander and Almeria played out a 1-1 draw.