
Having struggled since La Liga restarted in mid-June following the coronavirus outbreak, the defeat left Barcelona on 79 points, seven behind Real Madrid with one game left.
Visitors Osasuna took the lead when Adrian Lopez set Pervis Estupinan free with a clever pass down the left, and his ball into the box was drilled into the bottom corner by striker Jose Arnaiz in the 16th minute.
Lionel Messi equalised for Barca with a sublime free kick in the 62nd minute after Luis Suarez was fouled just outside the box, but Osasuna overcame the sending-off of Enric Gallego to snatch a winner through Torres in stoppage time.