The Slovenian had a decent gap as he entered the final kilometre, while Sagan was among the riders dropped at the back of the bunch.
Van Avermaet attacked inside the final 500m, as did Yates, but Roglic stood firm even as the fierce gradients of the final kilometres bit hardest.
Yates closed in fast but ultimately not fast enough, just running out of road as Roglic celebrated the stage win ahead of the Englishman and Benoot.
Thomas stole a march on the rest of the bunch, meanwhile, and will now wear the blue jersey on stage four – the queen stage, which concludes with the Sarnano Sassotetto climb.
Tirreno-Adriatico 2018: stage three – result
1) Primoz Roglic (SVN) – LottoNL-Jumbo – 6.17.23hrs
2) Adam Yates (GBR) – Mitchelton-Scott +3”
3) Tiesj Benoot (BEL) – Lotto-Soudal +6”
4) Geraint Thomas (GBR) – Team Sky +7”
5) Rigoberto Uran (COL) – EF-Drapac +10”
6) Mikel Landa (ESP) – Movistar – ST
7) Gianni Moscon (ITA) – Team Sky
8) Romain Bardet (FRA) – Ag2r-La Mondiale
9) Wilco Kelderman (NED) – Team Sunweb
10) Bob Jungels (LUX) – QuickStep Floors
General classification
1) Geraint Thomas (GBR) – Team Sky – 10.52.22hrs
2) Greg van Avermaet (BEL) – BMC Racing – ST
3) Chris Froome (GBR) – Team Sky +3”
4) Damiano Caruso (ITA) – BMC Racing +8”
5) Michal Kwiatkowski (POL) – Team Sky +9”
6) Bob Jungels (LUX) – QuickStep Floors – ST
7) Wilco Kelderman (NED) – Team Sunweb +19”
8) Davide Formolo (ITA) – Bora-hansgrohe +30”
9) Tom Dumoulin (NED) – Team Sunweb +33”
10) Rigoberto Uran (COL) – Team EF-Drapac +39”