Messi signals return with 2 goals in Barcelona's win over Getafe
The four-time World Player of the Year replaced Andres Iniesta after 63 minutes with Barcelona leading 2-0 thanks to a Cesc Fabregas double.
Messi put the tie to bed a minute from time when he slotted home a loose ball inside the area.
And he added his 16th goal of the season with a stunning run and finish to round off the scoring in stoppage time.
With Saturday's upcoming top of the table clash away to Atletico Madrid in mind, Barca boss Gerardo Martino had made six changes to the side that started last weekend's 4-0 win over Elche.
However, with Messi and Neymar, ruled out by a stomach bug, again not in the starting line-up, Martino maintained the front three of Alexis Sanchez, Pedro Rodriguez and Fabregas.
The Argentine coach's selection proved inspired as Pedro's lobbed cross was expertly headed into the far corner by Fabregas after just eight minutes.
And Fabregas added a second from the penalty spot after Pedro had been upended by Juan Valera seconds before Messi's introduction.
Messi had been sidelined since he tore his hamstring early on in Barca's 4-1 win away to Real Betis on November 10.
After beginning his treatment for the injury in Barcelona, he travelled to his native Argentina to continue his recovery process during December.
He returned to the Catalan capital to take part in training on January 2, but was left out of Martino's squad for Elche clash to allow him a few more sessions alongside his teammates before returning.
Despite scoring 14 times in 16 appearances this season, Messi's campaign has been beset by fitness problems as he was also ruled out for shorter periods in August and October with muscular injuries.
Related Barcelona News