Lionel Messi opened the scoring on 28 minutes with a well-placed header from Sergio Busquets' pinpoint pass. That strike means Messi has scored more than 30 league goals in a season for the ninth time in his career.
But Celta were level 10 minutes later through Santi Mina, who scored from the visitors' first effort on goal.
Barca were reduced to 10 men late on when Clement Lenglet received a second yellow card but the real drama was still to come as Mina scored in the 89th minute to secure an unlikely victory for Celta.
"We hope that won't be his last game here at the Camp Nou, but it's a decision he needs to make," defender Jordi Alba said.
"We were really good in the first half, they didn't really create much and took their one chance when they got it.
"We had the game under control but in the second half just lost our heads a bit. They play really good football, they made it difficult for us and their second goal is unlucky for us."