Racheal Kundananji scored twice in seven first-half minutes for the Madrid club, before Ballon d'Or winner Alexia Putellas pulled a goal back for Barca after half-time.
It was the first league defeat for Barca since June 1, 2021 -- when they lost 4-3 at Atletico Madrid -- a run of 64 games without defeat.
The team had won 62 consecutive league games -- a world record in both men's and women's professional football -- before a 1-1 draw with Sevilla on May 10.
Barca's last game this season is the UEFA Women's Champions League final on June 3, facing Wolfsburg in Eindhoven.
It will be their fourth Champions League final in five years, after they were beaten 3-1 by Lyon in last year's final