The striker pounced with five minutes to go when he latched onto Claudio Marchisio's cross and thrashed the ball high into the net from the corner of the six-yard box to delight the fans who had been on tenterhooks at the Artemio Franchi stadium.
The win gave Italy an unassailable eight-point lead over second-placed Serbia with both teams having two matches left.
The Italians qualified along with holders Spain on Tuesday after Germany on Friday became the first team to qualify for next year's finals in Poland and Ukraine.
"It's very emotional to qualify here at the [Artemio] Franchi," Cesare Prandelli, Fiorentina's former coach, told reporters. "This team has made big steps but we still have to get a lot better.
"We tried to take the game [to Slovenia] tonight and we just needed a bit more luck in front of goal to make our lives easier. I'm glad we stuck to our game plan but we need to improve in finding ways of beating sides that defend in depth."
The home side struggled to beat the Faroe Islands 1-0 on Friday with a team short of match practice due to a strike called over players' rights, which has since been resolved, but they began well enough against Slovenia.
Italy carved out three gilt-edged chances in the first five minutes although they then laboured to create any more opportunities against a stubborn defence until Prandelli threw on Pazzini, Marchisio and Mario Balotelli late on.
Slovenia, who lost at home to Estonia on Friday, have little hope of qualifying after slipping to fourth in the group and trail Serbia by three points having played a game more. Serbia beat visitors the Faroe Islands 3-1 on Tuesday.
Italy, after a subdued performance in the 1-0 win away to the Faroe Islands four days ago, started the match like they had something to prove and had a host of early chances.
Giuseppe Rossi, back in tandem with Antonio Cassano, had a low shot saved in the first move and Riccardo Montolivo then glanced a header just wide before the Fiorentina midfielder, playing on his home pitch, slipped in Daniele De Rossi whose skewed shot from the left side of the area whistled wide.
Slovenia eventually settled into the match but it was Italy who came close again after 18 minutes when the elusive Rossi's weak shot trickled wide after an astute pass from Cassano.
The home side were almost made to pay for their misses three minutes later when Dare Vrsic was allowed to turn on the edge of the box and hit a 20-metre drive that Italy goalkeeper Gianluigi Buffon was forced to beat away.
Prandelli, returning to the stadium where he managed for five years before becoming Italy coach after the 2010 World Cup, had called on the Florence public to overcome the transport chaos created by a national strike and cheer the Azzurri to qualification.
Most of the 18,000 crowd were on the edge of their seats again before the break when Thiago Motta, who got the winner when the teams met in Ljubljana in March, miskicked from 10 metres a
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.