Real Zaragoza's four-year stay in the Primera Division ended as they slipped to a 3-1 defeat at the hands of Atletico Madrid in a game where all the scoring came in the final six minutes.
Celta Vigo's defeat of Espanyol rendered the result of this contest irrelevant and Arda Turan's late strike appeared set to decide the contest in Atletico's favour.
Helder Postiga equalised in the 89th minute, but a miserable night for the hosts at La Romareda was capped by two injury-time goals from Diego Costa.
Atletico were assured of third place before kick-off and this result means they end the campaign with the best away defensive record in the league.
Zaragoza started brightly and six minutes had passed when Victor Rodriguez's 20-yard effort was blocked by Thibaut Courtois.
Five minutes later and Courtois needed to be at his best to tip away Antonio Apono's well-struck 20-yard shot.
However, a reminder of the quality of the team they were playing came in the 14th minute when Costa struck the bar with a header from Jorge Koke's free-kick.
The visitors finished the first half strongly, with Costa seeing a 12-yard effort blocked by Leo Franco in the 43rd minute, shortly before the Zaragoza goalkeeper reacted sharply to snuff out the threat of Koke's inswinging corner.
Atletico started the second half as they finished the first, on the front foot.
After Costa had seen a 53rd-minute shot blocked by Glenn Loovens, Franco punched another testing Koke corner to safety.
Although Postiga shot wide for the hosts in the 56th minute, home frustration was building and it hit a new high in the 65th minute when Atletico defender Joao Miranda got his angles right to block Henri Bienvenu's shot from six yards out.
Courtois saved Paco Montanes' 73rd-minute header as the home side sought a breakthrough while hoping Celta would concede.
The late goal burst started when substitute Turan received the ball from Emiliano Insua and fired high past Franco from 12 yards.
Postiga briefly raised home hopes with an 89th-minute equaliser from close range following good work by Bienvenu.
However, within seconds of his introduction Daniel Aquino crossed for Costa to restore the visitors' advantage in the first minute of injury time.
And less than a minute later Koke was the provider as Costa again fired past Franco.