Lionel Messi's 23rd-minute opener was cancelled out by Darwin Machis, whose goal in the 63rd minute was almost a mirror image of the six-time Ballon d'Or winner's left-footed drive.
Two substitutes, Jorge Molina and Adrian Marin combined for the winner. Molina, who wasn't marked well by Gerard Pique in the box, headed in Marin's cross to stun Barcelona.
Barcelona coach Ronald Koeman was sent off following Granada's equaliser and had to see his side suffer a loss at the Camp Nou from the stands. Earlier, Antoine Griezmann continued his fine form and was the provider for Lionel Messi's 26th goal of the campaign.
Granada threatened before the break but just couldn't find the finishing touch. However, they scored twice in the second half to deal a telling blow to Barcelona's title hopes.
A win would have seen Barcelona atop the La Liga summit, but a loss means the Blaugrana remain behind Atletico Madrid and Real Madrid in the league standings. On that note, let's take a look at the five talking points from the game.
#1 Granada record their first win at the Camp Nou
The win at the Camp Nou was a historic one for the Nazaríes. It was the Andalusian club's first-ever win away at Barcelona in 25 attempts.
Barcelona had a 100% record against Granada in 24 previous La Liga meetings between the two teams at Camp Nou. Barcelona were the favourites to get all three points one again. And they got off to a great start by breaking the deadlock in the 23rd minute.
However, Granada showed nerves of steel as they came back from behind, despite having just 18% of possession. The visitors scored twice from five shots on target, and Barcelona failed to muster a response.
#2 Barcelona head coach Ronald Koeman gets sent off
It is not a rarity to see managers being awarded a red card. Usually, it is reserved for violent conduct, but Ronald Koeman saw one for expressing what was his displeasure at Barcelona conceding a goal.
Notably, Koeman didn't argue with match officials. But the timing of the red card was unfortunate for Barcelona, as it was right after they conceded a goal.
Koeman could now be out for at least two games, and that would mean Barcelona would be without their manager on the sidelines during a crucial juncture in the season.
#3 Lionel Messi returns to scoring ways, albeit in a losing cause for Barcelona
Barcelona captain Lionel Messi registered his 26th goal of the campaign, scoring a beauty from his gifted left foot. After drawing a blank in terms of assists and goals in his previous outing, the talisman got back to scoring ways against Granada.
He has now been involved in more goals this year than any other player across Europe's top-five leagues. With 19 goals and eight assists since the turn of the year, Lionel Messi has had a telling contribution for Barcelona.
However, Barcelona failed to build on the lead provided by their captain and slumped to a shock defeat that could have implications in a tight La Liga title race.
#4 Granada ignites top-six hopes with historic win
After returning to the La Liga in 2019-20, Granada secured a creditable seventh-placed finish.
They have hit form at the right time this campaign, winning three of their last four games. This run of form has seen Granada just five points off a European qualification spot.
If they continue their strong form after a historic win at Barcelona, Granada could secure a top-six finish at the expense of Real Betis.
#5 La Liga title race sees another twist
The La Liga title race this year has been a hotly contested one. Following Barcelona's shock defeat, Atletico Madrid remain top of the pile, two points clear of both Real Madrid and the Blaugrana.
Barcelona could've opened up a one-point lead at the top with a win against Granada. Instead, they remain third, while the gap between table-toppers Atletico Madrid and fourth-placed Sevilla is now only three points going into the last five games of the season.
Atletico Madrid lead the pack with 73 points; both Real Madrid and Barcelona have 71 points, while Sevilla, riding a five-game win streak, have 70 points.
The next game week sees two potential title-deciding matches. Barcelona take on Atletico, while Real Madrid host Sevilla.