Barcelona suffered a first La Liga home defeat in 43 games, falling to Osasuna on the night they lost their La Liga title to Real Madrid.
Even a win over the mid-table side would not have been enough for Barca, as Madrid beat Villarreal 2-1.
Jose Arnaiz put Osasuna ahead before Lionel Messi levelled with a free-kick.
The visitors had Enric Gallego sent off for elbowing Clement Lenglet before Roberto Torres’ close-range winner from Kike Barja’s cross in injury time.
Barcelona XI: Messi, Pique, Rakitic, Braithwaite, Ter Stegen, Roberto, Lenglet, Semedo, Firpo, Riqui Puig, Fati
Subs: Suarez, Vidal, Alba, Busquets, Neto, Arthur, De Jong, R. Araújo, Arnau Tenas
Osasuna XI: A.López, Iñigo Pérez, Aridane, R.Navas, Brasanac, David García, Sergio Herrera, N.Vidal, Arnaiz, P. Estupiñán, Moncayola
Subs: Roncaglia, Rubén, Oier, Roberto Torres, Enric Gallego, T.Lato, Kike Barja, Juan Pérez, Javi Martínez, José Hualde, Aimar Oroz