Lionel Messi scored his 650th goal for Barcelona against Athletic Bilbao, who are currently second in La Liga.
Five athletes were blocked, one standing behind him while one stood on the line but Messi curled the ball into the back of the net.
Athletic snatched the ball through Jordi Alba.
But Antoine Griezmann scored the winner after Oscar Mingueza handed it to them.
Barcelona lead Real Madrid on goal difference, but are all 10 points behind Atletico Madrid – and will face them after beating Cadiz on Sunday.
Ronald Koeman’s side appear to have put an end to their goal-scoring campaign at the start of the season, winning eight and drawing two of their last 10 matches in La Liga.
Barcelona closed on Sunday more than they had before, dismissing reports that they had breached Messi’s contract with El Mundo.
The Spanish giants are suing the newspaper in court over the publication of Messi’s £ 492m contract.