The Australian sprinter had lead-out man Luka Mezgec to thank for reeling in a late attack by Philippe Gilbert (Quick-Step Floors), before Ewan launched his final acceleration for the line.
Ewan and Boasson Hagen were well clear of most of the rest of the sprinters with only Alexander Kristoff (Katusha-Alpecin) in their wheels, and it was Ewan who won by half a wheel on the line.
Erstwhile race leader Elia Viviani (Team Sky) finished in seventh place and out of the time bonuses, meaning that the leader's green jersey went back to Ewan.
>>> Tour of Britain 2017 route: stage-by-stage details and where to watch
How it happened
The third stage of the 2017 Tour of Britain rolled out from Normanby Hall under teeming rain, with the slick roads taking no prisoners as James Lowsley-Williams (Bike Channel-Canyon) crashed on a slipper right-hand bend while trying to get away from the peloton.
After a few kilometres five riders were able to escape, all from British domestic teams, and including Graham Briggs (JLT Condor) who made it into the break for the third day in succession. Also in the move were Harry Tanfield (Bike Channel-Canyon), Peter Williams (One Pro Cycling), Matthew Holmes (Madison Genesis), and Briggs's JLT-Condor team-mate Ian Bibby.
The break established and given a lead of around 3-30, Team Sky moved to the front of the peloton to control the race in the testing wet and windy conditions.
Geraint Thomas was the Sky rider charged with maintaining the gap, and he did a sterling job setting the pace almost single handedly while Briggs led the race through all of the intermediate sprints and over the first two KOM points to move into the lead of both competitions.
With 75km remaining the gap finally started to fall, the seconds ticking away and falling under two minutes for the first time with 35km to go.
By that point Katusha-Alpecin and Orica-Scott had joined Team Sky in the chase, and just after the final KOM point at Winterton which was taken by Bibby, the catch was made.
From there a bunch sprint seemed inevitable, but that didn't deter Rob Partridge (Bike Channel-Canyon) nor Simone Andreeta (Bardiani CSF), both of whom launched solo attacks which were duly reeled in by the sprinters' trains.
Having held back for most of the Dimension Data hit the front en masse with four kilometres remaining, four riders sitting in front of Edvald Boasson Hagen, who was hoping to make amends for being relegated on stage two.
With 600m Philippe Gilbert attempted to upset the odds with a strong late attack, but was reeled in by a strong lead-out effort by Luka Mezgec (Orica-Scott), before Ewan burst clear.
The diminutive Australian was challenged hard by Boasson Hagen, but held off the Norwegian's challenge to take his second stage win of the race and move back into the overall lead.
Tour of Britain 2017, stage three: Normanby Hall Country Park to Scunthorpe, 178km
1. Caleb Ewan (Aus) Orica-Scott, in 4-04-05
2. Edvald Boasson Hagen (Nor) Dimension Data
3. Alexander Kristoff (Nor) Katusha-Alpecin
4. Brenton Jones (NZl) JLT Condor
5. Mads Würtz Schmidt (Den) Katusha-Alpecin
6. Andrea Pasqualon (Ita) Wanty-Groupe Gobert
7. Elia Viviani (Ita) Team Sky
8. Philippe Gilbert (Bel) Quick-Step Floors
9. Daniele Bennati (Ita) Movistar
10. Nikolas Maes (Bel) Lotto-Soudal, all at same time
General classification after stage three
1. Caleb Ewan (Aus) Orica-Scott, in 4-04-05
2. Elia Viviani (Ita) Team Sky, at 6 secs
3. Edvald Boasson Hagen (Nor) Dimension Data, at 7 secs
4. Karol Domagalski (Pol) One Pro Cycling, at 14 secs
5. Silvan Dillier (Sui) BMC Racing, at 15 secs
6. Kamil Gradek (Pol) One Pro Cycling, at 15 secs
7. Alexander Kristoff (Nor) Katusha-Alpecin, at 16 secs
8. Fernando Gaviria (Col) Quick-Step Floors, at 16 secs
9. Lars Boom (Ned) Team LottoNl-Jumbo, at 18 secs
10. Zdenek Stybar (Cze) Quick-Step Floors, at 20 secs
Ethan Vernon to debut Hope TT bike at World Championship U23 time trial
First international appearance for the roadgoing version of the Great Britain Hope x Lotus track bike
By Simon Smythe •
Wout van Aert and Remco Evenepoel looking for extra one per cent at Worlds as task of beating Filippo Ganna looms
The Belgian duo hope for home advantage in order to defeat the Italian in the men's elite individual time trial
By Jonny Long •
Caleb Ewan peerless in final stage sprint as Julian Alaphilippe wins 2018 Tour of Britain overall
Australian repays Mitchelton-Scott's faith in his last race with the squad
By Owen Rogers •
Caleb Ewan sprints to third victory on Tour of Britain stage six
Australian sprinter Caleb Ewan secures third stage win in another day for the fast men at the 2017 Tour of Britain
By Craig Cunningham •
Caleb Ewan wins Tour of Britain stage eight as Steve Cummings wraps up overall
Caleb Ewan finished well clear of his sprint rivals on the Tour of Britain final stage circuit race in central London
By Richard Windsor •