Xavi, who was brought on in the 54th minute on Saturday as Barcelona searched for their opening goal at home, kept his team's 100 percent record alive when he hit the back of the net in the 87th minute.

Barcelona had 20 shots for the game, including 11 on target, but they had to wait until Xavi collected the ball on the edge of the penalty area and then struck off the crossbar to take the lead.

In the 92nd minute, Lionel Messi created the clincher goal for Barcelona, getting free on the left-hand side of the box and then crossing into the middle where Granada defender Borja Gomez stuck out a foot and deflected the ball into his own net.

Barcelona remain top of La Liga with a perfect 15 points from five matches with Malaga, who have a game in hand, second on 10 and Real Betis sit third a further point behind.

Celta de Vigo claimed their second victory in three matches to move up to ninth on the La Liga table thanks to two assists from Danish winger Michael Krohn-Dehli in a 2-1 triumph over Getafe.

Krohn-Dehli, who joined Vigo from Danish club Brondby in August, set up his new club's first goal when he cut in from the left wing and then passed between two Getafe defenders to Augusto Fernandez, who sprinted into the box to score with a fine finish in the 57th minute.

Getafe hit back just two minutes later when Abdelaziz Barrada smashed Diego Castro's cross into the roof of the net but Vigo earned the victory in the 69th minute when Krohn-Dehli chipped a well-weighted pass to the back post and substitute Park Chu-Young leapt high to volley the ball home.

It was the Korean striker's first goal for Vigo since joining the Spanish club on loan from Arsenal.

Getafe's day got even worse in second-half injury time when their defender Alexis was sent off.

In other La Liga results, Real Zaragoza knocked off Osasuna 3-1, while Real Betis defeated Espanyol 1-0.