Barcelona suffered defeat in their first match since winning La Liga as Real Sociedad boosted their Champions League qualification hopes.
Sociedad scored in the fifth minute when Alexander Sorloth set up Mikel Merino to finish from close range.
Sorloth then added a second in the 72nd minute to give the visitors a deserved two-goal lead.
Robert Lewandowski pulled a goal back in injury time but the champions were unable to find a leveller.
Barcelona sealed their first La Liga title since 2018-19 with four games to spare last weekend by winning away to city rivals Espanyol.
On Saturday, they lifted the La Liga trophy in front of their home supporters after the match with Sociedad at the Nou Camp.
With the win, fourth-placed Sociedad restored their five-point gap over Villarreal in fifth.