Barcelona's title hopes disappeared following a 2-1 loss with Osasuna as Real Madrid were crowned La Liga champions.
Real Madrid's 2-1 win over Villarreal secured the league title on 86 points for the capital club, condemning Barca to 79 points and second place with one match left in the season.
Barcelona had led Real before the league took a three-month break in March due to the coronavirus pandemic, but Real rode an impressive string of 10 straight victories after the restart to overcome their bitter rivals.
Lionel Messi, who scored Barca's lone goal in Thursday's loss, expressed his frustration on the game and his club's overall campaign.
"We didn't expect or want it to end in this way, but it's a reflection of the season in a way," Messi said after the match. "An inconsistent, weak team that is beaten in intensity and enthusiasm.
"It's been easy to score goals against us. We lost a lot of points when we shouldn't have done and have been really inconsistent."
Osasuna took the lead at Camp Nou in the 15th minute on Jose Arnaiz's right footed shot from the centre of the box to the bottom left corner. But Messi equalised it on a superb bend around the wall on a free kick in the 62nd, clipping the post past goalkeeper Sergio Herrera.
Luis Suarez, who came on as a second-half substitute, seemingly got the equaliser on a acrobatic volley in the 68th minute from Messi's pass, but the goal was ruled offside.
Osasuna's Enric Gallego received a red card for an elbow to Clement Lenglet in the 78th minute but Barca could not take advantage of the extra man to net the game winner.
Instead, Barcelona's frustrating season was summed up when Torres snatched a winner deep into stoppage time, catching the defence flat-footed before hammering home Enrique Barja's cross.
Barca, winners of the previous two La Liga crowns, will finish the season on Sunday against Alaves. They are back in action against Napoli on Aug. 8 in the second leg of their Champions League round of 16 clash.