Scotland needed a win to go through but they were put to the sword by Italy, who earned their first ever win on their opponents' soil.
Luca Toni stunned the home crowd as early as the second minute before Barry Ferguson grabbed the equalizer with a controversial strike five minutes past the hour mark.
Roma defender Panucci headed home in stoppage time to help Italy book a place in next year's finals in Austria and Switzerland.
Italy are on top of Group B with 26 points, one ahead of second-placed France, with both having one fixture remaining. Scotland lie third on 24 points and have completed their matches.
Bayern Munich striker Toni opened the scoring after just two minutes, firing home Antonio Di Natale's pass inside the area with the outside of his right foot.
Scotland then threatened Gianluigi Buffon more than once through set-pieces, thanks to a poor marking by Italy defenders.
The visitors had a goal controversially disallowed due to offside. Di Natale poked home on the rebound after Massimo Ambrosini's shot was parried by the keeper.
However, Television replays proved that the linesman's flag was incorrectly raised.
Another controversial decision by the assistant saw Ferguson level the score in the 65th minute.
Ferguson struck into an empty net after Buffon blocked Lee McCulloch's effort but he was in an offside position when doing so.
In the dying minutes, Panucci missed an open goal with his head but made amends few moments later.
Panucci rose to head Andrea Pirlo's free-kick from the right into the back of the net to break Scotland's hearts.