Galimzyanov rode the back of the Liquigas lead-out train that was trying to bring home Saturday's winner Elia Viviani before springing for the victory after the 118km stage from Tiananmen Square to the Bird's Nest Olympic Stadium.
Saxo-Bank's Juan Jose Haedo took second place with Viviani having to settle for third.
Martin on the other hand stayed out of trouble on the final day around the Chinese capital, with the German world time-trial champion having led the race ever since the opening day time-trial.
Next in the overall standings came a trio of Brits - David Millar (Garmin-Cervelo) finished second 17 seconds behind Martin and he was followed by the Team Sky duo of Vuelta runner-up Chris Froome and Steven Cummings.
Ireland's Nicolas Roche finished 11th in General Classification.
For Martin, winning his first tour since being crowned world time trial champion was something special. "Putting on the rainbow jersey was really nice and gave me a lot of confidence coming into this race. I knew I still had good form and I had a really strong team to back me up. I'm really happy that it all worked out."
Martin will return to Europe for Chrono de Nations, his last race before ending his season and another chance to wear his world championship stripes.
Denis Galimzyanov, who also won the green jersey for topping the points classification, was willing to share the credit for his win.
"Today I was very motivated for a victory. Katusha Team did a fantastic job during the whole stage. I want to thank all guys, especially Nikolay Trusov, who was near me all the day, he protected me from the wind and rivals. It was something special," he said.