Italy crashed out of Euro 2004 despite beating already-eliminated Bulgaria 2-1 with a late goal on Tuesday.
Italy finished level with Denmark and Sweden on five points in Group C but a 2-2 draw between the Scandinavian neighbours in Porto in the other Group C match on Tuesday means the Italians go home by virtue of fewer goals scored.
Bulgaria, who lost their opening two games without scoring, had taken a shock 1-0 halftime lead with a Martin Petrov penalty just before the break, awarded after Marco Materazzi pulled back Dimitar Berbatov in the area.
Italy, runners-up to France in Euro 2000, equalised three minutes after the break when Simone Perrotta hooked the ball in with the outside of his right foot from close range after a shot from Antonio Cassano hit the underside of the bar.
Cassano then popped up with the winner deep into stoppage time but it was not enough to put the Italians through.
In an uninspired first half neither team settled on a slippery, rain-lashed surface and there were few chances.
Bulgaria, though, surprisingly broke the deadlock just before halftime with a penalty -- their first goal of the tournament -- leaving Italy coach Giovanni Trapattoni to decide his options during the halftime break.
After Italy equalised in the 48th minute, he decided to risk striker Christian Vieri, left out of the starting lineup with an injured knee, bringing him on after 53 minutes for Bernardo Corradi.
Vieri immediately pepped up the Italian strike force, and they attacked for almost the entire second half in search of an all-important second goal.
Cassano wasted several chances, opting to shoot himself rather than play in better-positioned opponents and Italy's frustration grew as the match progressed.
Hardly a classic compared to some of the matches over the last few days, it was nevertheless a tense and keenly fought match with the Bulgarians trying to hang on to a point.
Italy were unlucky not to be awarded a penalty when substitute Kiril Kotev brought down Cassano after 76 minutes but Russian referee Valentin Ivanov waved play on.
Teams:
Italy (4-3-3): 1-Gianluigi Buffon; 2-Christian Panucci, 13-Alessandro Nesta, 23-Marco Materazzi (17-Marco Di Vaio 83), 19-Gianluca Zambrotta; 14-Stefano Fiore, 21-Andrea Pirlo, 20-Simone Perrotta (3-Massimo Oddo 68); 18-Antonio Cassano, 7-Alessandro Del Piero, 11-Bernardo Corradi (9-Christian Vieri 53).
Bulgaria (4-3-3): 1-Zdravko Zdravkov; 7-Daniel Borimirov, 18-Predrag Pazhin (6-Kiril Kotev 64), 5-Zlatomir Zagorcic, 22-Ilian Stoyanov; 21-Zoran Jankovic (20-Valeri Bojinov 46), 8-Milen Petkov, 15-Marian Hristov (10-Velizar Dimitrov 79); 17-Martin Petrov, 9-Dimitar Berbatov, 11-Zdravko Lazarov
Referee: Valentin Ivanov (Russia)
Linesmen: Yury Dupanau (Belarus), Vladimir Eniutin (Russia