Reigning Tour de France champion Egan Bernal won the Route d'Occitanie, with Team Ineos rival Chris Froome finishing nearly 10 minutes behind.
Froome began the day five minutes 21 seconds adrift of the 23-year-old, having reacted to fans who were booing him on the previous day's stage.
The pair are racing to be selected to compete at this year's Tour for Ineos.
Britain's four-time Tour winner Froome, 35, risks not being selected if his form is not deemed strong enough.
A small number of fans shouted and directed boos towards Froome during Monday's queen's stage, prompting him to turn around and make a gesture.
Froome may not make Tour if he loses warm-up race 'play-off' with BernalBernal finished the four-day race nine minutes 26 seconds faster than 37th-placed Froome in the overall standings.
Colombian Bernal was 19 seconds ahead of promising Ineos rider Pavel Sivakov, 23, who was second in the general classification.
The final stage was won by AG2R La Mondiale's Benoit Cosnefroy, two seconds ahead of Bernal and another Tour contender in Thibaut Pinot of Groupama FDJ.
Pinot was fourth in the general classification - 37 seconds down.
The second of three crucial Tour warm-up races is the Tour l'Ain on 7 August, where all three of Ineos' Tour winners will race - Froome (who won in 2013, 2015, 2016 and 2017), Geraint Thomas (2018) and Bernal (2019).
Tuesday's stage began with Ineos remembering their former sporting directeur Nico Portal, who died aged 40 in March.
Ineos remembered Portal with members of his family by applauding'Froome has time to put things right' - analysis
Matt Warwick, BBC Sport
Well, that was not the start to a sequence of critical races Froome would have wanted. Bernal's decisive move to win was explosive, and Froome's old adversaries - a small number of French fans - appear to have come back to taunt him.
Froome is a level-headed and patient man, and he can easily accept a heavy defeat such as this and move on. He has time to put things right - and is well versed in coming from a long way back.
What he will not appreciate are the fans hurling abuse. He made his feelings known at one point on a tight bend, shouting back at them - and rightly so.
If those fans determined to lambast Froome fear further dominance of the Tour by a British team without any French riders, they should vent at Bernal.
But at the moment, he's too quick to be shouted at on a mountain side path - let alone followed up one.
Stage 4 times:
1. Benoit Cosnefroy (Fra/AG2R La Mondiale) 4hrs 23mins 28secs
2. Bauke Mollema (Ned/Trek-Segafredo) @2secs
3. Thibaut Pinot (Fra/Groupama-FDJ) @2secs
4. Egan Bernal (Col/Team Ineos) @2secs
5. Aleksandr Vlasov (Rus/Astana) @2secs
6. Alexis Vuillermoz (Fra/AG2R La Mondiale) @7secs
Selected other:
71. Chris Froome (GB/Team Ineos) @4.07
General Classification final standings:
1. Egan Bernal (Col/Team Ineos) 17hrs 57mins 27secs
2. Pavel Sivakov (Rus/Team Ineos) @19secs
3. Aleksandr Vlasov (Rus/Astana) @23secs
4. Thibaut Pinot (Fra/Groupama-FDJ) @37secs
5. Bauke Mollema (Ned/Trek-Segafredo) @1.09
6. Richie Porte (Aus/Trek-Segafredo) @1.26
Selected other:
37. Chris Froome (GB/Team Ineos) @5.21