The German rider won the 126-kilometre stage, which started near the Bird's Nest Stadium, after breaking away from a leading group on the descent following the final climb.
"If there is no time-trial, you have to do your own one," said Martin, who missed this year's time trial. "Some guys were expecting a sprint, but my team expected a hard race. The goal was to make a good race and to stay at the front, but I didn't expect to win. I had a very, very small chance today but I took it and I am very happy and proud of this."
The time-trial world champion held off the chasing pack to finish in 2 hours, 37.49 seconds. Martin holds a 50-second lead in the general classification ahead of Italian rider Francesco Gavazzi (Astana) and 52 seconds ahead of Eros Capecchi (Liquigas-Cannondale), who were second and third in the stage.
The race's turning point came in the last 5-kilometre ascent when Tom Jelte Slagter (Rabobank) accelerated before the summit, followed by Martin. The German all-rounder then attacked at the beginning of the twisty downhill, with 25 kilometres to go.
"A rider from Rabobank didn't close the gap when Martin left. We didn't react quickly enough and some riders didn't help, saying they had no interest in general classification," Movistar rider Rinaldo Nocentini said. "That's a pity. We could have done much better and even if we didn't catch Martin, we could have taken more time on the groups behind us."