Maris Verpakovskis scored one goal and set up another as Latvia booked their first trip to the European Championship finals at Turkey's expense.
Latvia will be at a European Championship for the first time
The underdogs earned a 2-2 draw in Istanbul to follow their shock 1-0 victory in the first leg in Riga.
Ilhan Mansiz and Hakan Sukur put Turkey 2-0 up on Wednesday as the World Cup sem-finalists looked to be bound for Portugal.
But Verpakovskis set up Jurijs Laizans on 66 minutes to put the Latvians back in contention before scoring an equaliser in the 77th to seal the upset.
Highly-fancied Spain made light work of Norway in Oslo, winning 3-0 on the night and 5-1 on aggregate.
Defending a slender 2-1 lead from their home leg, the Spanish visitors showed all the industry and skill.
And they took a well-deserved lead after 34 minutes when prolific marksman Raul outpaced Ronny Johnsen to score.
Goals by Vicente Rodriguez and Joseba Etxeberria made the result safe.
"The first goal was important because it gave us confidence. We can now start
dreaming about doing well in Portugal," said Raul afterwards.
The defeat also resulted in Norway coach Nils Johan Semb leaving his post after a five-year reign.
He said: "They were simply better than us on all levels.
"We had no real chance. We didn't manage to match their tempo. This was no pleasant exit."
Semb, who led Norway to Euro 2000, leaves after 29 wins, 21 draws and 18 losses.
Monaco striker Dado Prso was Croatia's hero again as they won 1-0 in Slovenia to seal their place in Euro 2004.
Prso - who was on target in a 1-1 first-leg draw - struck on the hour to rubber-stamp Croatia's ticket to Portugal.
Croatia survived the sending off of Igor Tudor for a second bookable offence to hang on and leave Slovenia heartbroken.
Tudor was shown the red card after 58 minutes.
But any hopes of Slovenia taking advantage were dashed only two minutes later when Prso produced the goal that proved to be the winner.
Elsewhere, there was no fairytale ending to Scotland's qualifying campaign.
Berti Vogts' men scraped through to the play-offs and pulled off a stunning 1-0 win over Holland in the first leg.
But the Dutch exacted sweet revenge on Wednesday hammering the Scots 6-0, thanks to a hat-trick from Ruud van Nistelrooy and goals from Wesley Sneijder, Andre Ooijer and Frank de Boer.
Wales fared little better, bowing out with a 1-0 home defeat at the hands of Russia.
Mark Hughes' team had scrapped their way to a commendable 0-0 draw in Moscow, but they were undone by a strike from Vadim Evseev on 22 minutes.