Sagan, of team Bora-Hansgrohe, burst past two rivals in the final sprint of the twisting, technical stage on Sunday (AEDT) to break his 15-month victory drought.
Britain's Adam Yates maintained his overall lead while Richie Porte, his Australian teammate at Ineos Grenadiers, remains in second place overall with just one stage left.
Porte finished 28th in the 193.8km ride from Tarragona to Mataro on Sunday and he trails Yates by 45 seconds.
Britain's Geraint Thomas, who also rides for Ineos Granadiers, is just four seconds behind the Australian in third place overall, setting the stage for the final ride on Sunday.