The 30-year-old Deceuninck-Quick-Step rider, who recently won stage four of the Tour de France, completed the 193km event in 3:46:16.
He beat Sam Bennett (Bora-Hansgrohe) and Michael Mørkøv (Deceuninck-Quick-Step) into second and third respectively.
Jasper Stuyven (Trek-Segafredo) placed fourth, with Amund Grøndahl Jansen (Team Jumbo-Visma) completing the top five.
“I have loved racing in London ever since the 2012 Olympics and today I was really motivated, as I knew the shape was good and the legs were strong coming out of Le Tour,” said Viviani.
“This is one of the five one-day races that I was really keen on winning in my career and having it now in my palmares feels really great.”
View more results below.
1. Elia Viviani (Ita) Deceuninck-Quick-Step 3:46:16
2. Sam Bennett (Irl) Bora-Hansgrohe
3. Michael Mørkøv (Den) Deceuninck-Quick-Step
4. Jasper Stuyven (Bel) Trek-Segafredo
5. Amund Grøndahl Jansen (Nor) Team Jumbo-Visma
6. Giacomo Nizzolo (Ita) Dimension Data
7. Alexander Kristoff (Nor) UAE Team Emirates
8. Oliver Naesen (Bel) AG2R La Mondiale
9. Jasper De Buyst (Bel) Lotto Soudal
10. Ethan Hayter (Gbr) Great Britain