The three-time Vuelta winner triumphed atop the daunting closing climb to Pico Villuercas to stake his claim for a record-equalling fourth success in one of cycling's three Grand Tours.
The Slovenia veteran, ably supported by his Red Bull-Hansgrohe teammates, reeled in a two-man breakaway up the gruelling 14.6km long ascent with a gradient of 16 percent over the final 5km.
Roglic was rewarded for his endeavour by taking over the race leader's red jersey.
He leads the UAE team's Joao Almeida by eight seconds in the general classification.
In a desperate scramble for the line Lennert Van Eetvelt had his arm raised in victory only for Roglic to pip him to the post, with Almeida in third.
"I always say, you never know when is the last (victory) so I just enjoy it," said the day's winner who was forced out of last month's Tour de France before the 13th stage.
"It's life, eh. It doesn't go all the way up, we have challenges. I'm just happy today with how the team worked and that I could finish it off at the end," he added.
Plenty of title contenders were left scattered down the mountainside in their wake as Roglic made a clear statement of intent about his chances of adding to his Vuelta wins in 2019, 2020 and 2021 to equal Roberto Heras as the race's most successful rider.
The race was entering Spain for the first time after three days in Portugal with this 170.5km ride from Plasencia to Pico Villuercas in the Extremadura region.
Wednesday's stage five will be easier on the legs with a less demanding 170km ride, tailormade for the sprinters, from Fuente del Maestre to Seville as the race heads into Andalusia.
That could give Wout van Aert hope of adding to his red jersey-clinching stage three win after trailing in 26 minutes adrift in the mountains.