The Lotto Soudal rider, who completed the 239km route from Tortoreto Lido in 5:43:32, claimed his second stage victory on the tour since his first in 2017, making it his third Grand Tour stage win.
Australia’s Ewan said afterwards the team had been trying for a victory and that he was happy to repay them with the win.
“I thought if I was feeling good that I’d go first through the last corner, but it was still a long way to go and I wasn’t feeling that good,” he said.
“It was quite a hard final – harder than I thought it would be. I knew I had a good kick so I just waited until Ackermann went, then I came around him.”
He added that the victory meant a great deal to him since he was under pressure to win races.
“The difference now is I’m expected to win. I had an alright start to the year, but not a great one. To win here means the world to me.”
Italian Valerio Conti, who finished 58th on the stage, held on to the overall leader’s jersey (35:13:06) ahead of stage nine tomorrow.
The UAE Team Emirates’ rider has an advantage of one minute and 32 seconds over Spaniard José Rojas (Movistar). His compatriot Giovanni Carboni (Bardiani CSF) lies third and one minute and 41 seconds behind.
Conti said the stage was hard when it came to a close. “In the downhill it was dangerous, but I have a big team, and they were super today,” he said.
“It was for the sprinters today so I stayed in the group. I hope to keep the maglia rosa tomorrow.”