Adam Yates (Mitchelton-Scott) finished second and Strade Bianche winner Tiesj Benoot (Lotto-Soudal) rounded out the podium while Geraint Thomas (Sky) moved into the lead, equal on time with Greg Van Avermaet (BMC) and Chris Froome (Sky) ominously in third.
"I came to Tirreno-Adriatico to win the overall. But we didn’t do our best TTT and we had some bad luck yesterday. I was forced to change my bike after the crash," Roglic said.
"My GC was over, so I needed to find some new goals because I worked really hard for this race. After winning a time trial at the Giro d’Italia (2016) and a mountain stage at the Tour de France (2017), I’m happy to get an uphill finish win.
"I’ve already lost some sprints in my career so I knew I shouldn’t wait for the last moment but just fight and go for it. The best feeling in cycling is when you don’t see anybody in front of you and you’re first on the finish line.”