The Slovenian, who had lost the overall lead in the Paris-Nice on the final ride last month after a crash, was on the attack far from the line on a descent during the 111.9-km mountain trek from Ondarroa to Arrate on Sunday (AEST).
Overnight leader Brandon McNulty did not follow Roglic and never managed to get back into contention despite the help of his UAE Emirates teammate and Tour de France champion Tadej Pogacar, who in the process relinquished his own title chances.
Roglic was in front with Briton Hugh Carthy and Frenchman David Gaudu on the last climb and benefited from the duo's work to increase his advantage.
Carthy dropped out in the middle of the ascent when Gaudu attacked, closely followed by Roglic.
The Jumbo-Visma rider was happy to stay on Gaudu's wheel and both exchanged a quick fist bump, meaning Roglic would not contest the final sprint having virtually wrapped up the overall victory with the Frenchman's help.
Gaudu crossed the line first for his maiden win in 2021 with Roglic also raising his arms in celebration in the background.
Overall, he beat his teammate Jonas Vingegaard by 52 seconds and compatriot Pogacar, who had pipped Roglic to the Tour de France title, by 1:07 as Briton Adam Yates took fourth place 1:26 off the pace, one second ahead of Gaudu.