Schleck finished 12 seconds ahead of seven-time Tour de France winner Armstrong of RadioShack in the overall standings, with Saxo Bank team-mate Jacob Fuglsang third at 17sec.
Dutch rider Robert Gesink, who had been wearing the leader's yellow jersey going into the final stage, finished fifth at 27sec after finishing over two minutes off Martin's winning time.
Schleck is not considered a time-trial specialist and admitted he had benefited from the advice of Saxo Bank team-mate Fabian Cancellara, the three-time world champion in the discipline, to post the 13th best time at 1min 14sec behind Martin.
"I was a little bit surprised myself that it went so well but the good thing about being on the same team as Fabian Cancellara is that you get to know a trick or two about time-trialling and he said I could pull it off before the stage," said Schleck.
Schleck was also quick to pay tribute to compatriot Kim Kirchen, the Katusha team rider who has been in a coma for two days after suffering a heart problem.
"Winning here so close to the Tour de France means a lot to me but my thoughts go to Kim Kirchen and his family who are having a hard time right now," he said.
Martin clocked 32min 21sec to finish 17sec ahead of Olympic time-trial champion Cancellara in the stage around Liestal.
Just two weeks before the start of the Tour de France, Armstrong finished 11th, 1min 09sec behind the stage winner.
Armstrong admitted recently he is trying to brush up on his time-trialling after a series of mediocre performances the past year.
And he was buoyed by his performance.
"It was a really hard time-trial, with nowhere to really rest. You just had to keep pedalling constantly," said the American.
"I felt good. I had good legs today."
Final Stage Results:
1. Tony Martin, Germany, HTC-Columbia, 32 minutes, 21 seconds.
2. Fabian Cancellara, Switzerland, Saxo Bank, 17 seconds behind.
3. David Zabriskie, United States, Garmin, :29.
4. Gustav Erik Larsson, Sweden, Saxo Bank, :48.
5. Levi Leipheimer, United States, Team RadioShack, same time.
6. Andreas Kloden, Germany, Team RadioShack, :52.
7. Jacob Fuglsang, Denmark, Saxo Bank, same time.
8. Maxime Monfort, Belgium, HTC-Columbia, :57.
9. Wouter Poels, Netherlands, Vacansoleil, 1:02.
10. Stijn Devolder, Belgium, Quick Step, 1:07. ^Also=
11. Lance Armstrong, United States, Team RadioShack, 1:09.
13. Frank Schleck, Luxembourg, Saxo Bank, 1:14.
Overall Standings:
1. Frank Schleck, Luxembourg, Saxo Bank, 35 hours, 2 minutes.
2. Lance Armstrong, United States, Team RadioShack, 12 seconds behind.
3. Jacob Fuglsang, Denmark, Saxo Bank, :17.
4. Steve Morabito, Switzerland, BMC Racing Team, :23.
5. Robert Gesink, Netherlands, Rabobank, :27.
6. Tony Martin, Germany, HTC-Columbia, same time.
7. Rigoberto Uran, Colombia, Caisse d'Epargne, :33.
8. Andreas Kloden, Germany, Team RadioShack, :48.
9. Joaquin Rodriguez Oliver, Spain, Katusha, 1:09.
10. Levi Leipheimer, United States, Team RadioShack, 1:14.
Schleck holds off Armstrong
Liestal - Luxembourg's Frank Schleck won the Tour of Switzerland here on Sunday ahead of American Lance Armstrong after the ninth and final stage, a 26.9km time-trial won by Germany's Tony Martin.