Xavi, who surpassed Migueli with his club record 392nd league appearance, curled a free kick from outside the area over the defensive wall into the top left corner for the 33rd-minute winner.
Granada had little possession inside Barcelona’s half and were further limited after Jaime Romero was sent off in the 53rd. Barcelona lost forward Pedro Rodriguez to injury shortly after.
Granada striker Dani Benitez was also sent off in added time.
Barcelona has 21 points, one better than Levante and two more than Real Madrid ahead of their games on Wednesday.