Striker Gary Hooper opened the scoring for the home side, who had to better Benfica's result in Barcelona, in the 21st minute but that was cancelled out by Ari before the break.
However, the Scottish champions were not to be denied and after defender Marek Suchy conceded a penalty kick in the 80th minute for a barge on Georgios Samaras, up stepped Kris Commons to slam the ball in off the bar.
Two minutes from time Spartak midfielder Kim Kallstrom picked up a second yellow card for a foul on Commons who was taken off on a stretcher, the only sour note in a momentous night for Lennon's side who, following tonight's goalless draw in the Nou Camp, finished second in Group G behind Barcelona with 10 points and who are in the knockout stages for the first time since season 2007/08.
The Parkhead men had to fight their way through two qualifying rounds and were then unfancied when drawn alongside the Russian club, Benfica and Barcelona and the Celtic manager was referring to that scepticism when he said: "It means the world to me as a young manager in my first year in the Champions League to qualify with 10 points, I am very proud of the players, they have performed a miracle.
"People laughed at me when I said at the start that my target was to qualify.
"No one gave us a prayer going into this group but we have qualified and deservedly so. I think you could see the players progressing last year.
"We have some really talented players who I felt could play at European level.
"I didn't want them just to be remembered for beating Barcelona but we have beaten Barcelona and qualified for the last-16 and that is a fantastic feather to have in your cap."
Celtic could face Manchester United, Malaga, Juventus, Bayern Munich, Borussia Dortmund, Schalke or PSG in the knockout stages.
The former Hoops skipper joked: "I would take Malaga - it would be nice this time of the year over there".
He then said: "Seriously, it is going to be really tough, against the top teams in the groups.
"You just don't know what shape teams are going to be in two or three months' time. But we are there, we are going to enjoy it and we want to progress as far as we can in the competition.
"Who knows where it can take you?
"The spirit is fantastic, we have some quality players, they have put everything into the group and they have grown as the campaign has gone on and some of them have enhanced their reputations no end.
"The draw is on the 20th and it is something that we look forward to, I just want them to concentrate on domestic duties now."
Lennon admitted he could not bear to watch Commons to take the crucial spot-kick.
"I didn't watch it, I turned my back on it," said the Northern Irishman.
"I'd seen the last couple of penalties and we missed them.
"I saw Gary Parker (coach) turn his back and so I thought I would wait until the roar goes up.
"Kris showed great mental strength to take it, I'm sure he was aware of the significance of the penalty but I thought he had a fantastic game.
"He has some bruising on his thigh."
Spartak caretaker coach Valery Karpin "didn't want to talk about the referee" with regards Celtic's penalty, however, he was mostly magnanimous in defeat.
He said: "I would like to congratulate Celtic, they deserved it because they have had a very good Champions League campaign.
"The referee blew his whistle for a penalty so it was a penalty.
"The first half was the probably the best we have played in a long time, so it is disappointing to lose matches when you play well.
"In the second half the three midfielders who were supporting the striker were not so influential.
"But I cannot blame any of our players, I have to thank them and the fans who came to Glasgow to support us when the game did not mean anything to us."