Gesnik kept the 46-second margin he earned by winning the penultimate stage, a rigorous climb on Saturday ending atop steep Mt. Baldy, by finishing in the pack in the final stage, a 70km ride ending in downtown Los Angeles.
American David Zabriskie finished second overall, 46 seconds off Rabobank rider Gesnik's pace, with countryman Thomas Danielson third, another eight seconds adrift.
Liquigas rider Sagan, who won the first four stages, claimed the last as well with a closing charge to edge top-ranked Tom Boonen at the line after the Belgian's Pharma-QuickStep team-mates set up their man down the final straight.
"I don't know if it could have been better. I'm very happy," Sagan said. "The last kilometres were really fast. It was good going."
Sagan hopes to carry the momentum from his US stage victories into the Tour de France.
"I hope I will do it good," he said of the French race. "I want to win one stage. I hope I do it."
Top finishers after Sunday's 70-km eighth and final stage of the Tour of California cycling race:
Stage:
1. Peter Sagan (SVK) (Liquigas) 1hr, 27mins, 36secs
2. Tom Boonen (BEL) same time
3. Gerald Ciolek (GER) s.t.
4. Roger Kluge (GER) s.t.
5. Heinrich Haussler (AUS) s.t.
6. Lloyd Mondory (FRA) s.t.
7. Ken Hanson (USA) s.t.
8. Daniel Oss (ITA) s.t.
9. Michael Matthews (AUS) s.t.
10. Guillaume Boivin (CAN) s.t.
Final overall standings:
1. Robert Gesink (NED) 30:42:32
2. David Zabriskie (USA) at :46
3. Thomas Danielson (USA) :54
4. Tejay Van Garderen (USA) 1:17
5. Fabio Andres Duarte (COL) 1:36
6. Levi Leipheimer (USA) 2:13
7. Wilco Kelderman (NED) 2:30
8. Chris Horner (USA) 2:49
9. Tiago Machado (POR) 2:54
10. Pieter Weening (NED) 3:05