Mads Pedersen surged away from his sprint rivals on Friday to take the 19th stage, his third victory in the last seven Vuelta a Espana stages, while race leader Remco Evenepoel finished comfortably in the pack.
Pedersen, a Dane who rides for Trek, powered away from Fred Wright and Belgian Gianni Vermeersch, to take the 138.3km stage that began and ended in Talavera de la Reina in central Spain.
With two stages to race, Belgian Evenepoel of Quick-Step remained two minutes and seven seconds ahead of Spaniard Enric Mas and 5min 14sec clear of third-placed Juan Ayuso.
The stage ended in a sprint after the pack reeled in a powerful breakaway.
"It was very hard to control the peloton, the team did an impressive job," said Pedersen. "I have to say thank you to the guys because without them I had no chance to win today."
Evenepoel said he had done a deal with the winner to help ensure the pack finished together.
"This was the perfect race," said Evenepoel. "I promised Mads to control the breakaway with him, so we did our job."
On Tuesday, when his closest rival Primoz Roglic suffered a race-ending crash, Evenepoel also had a scare when he punctured.
But the Belgian was given the same time as the main bunch because he was less than 3km from the finish when he stopped.
He said those events were on his mind on Friday and he was just aiming to make it to the last 3km "in case I would get a flat tyre or a bike problem. It's just to stay safe, because tomorrow is the last day and the biggest fear today was to have a crash or to be unlucky. So that's why we were trying to stay in front."
"Then, the last 1.3km was a straight line, so then I could slow a bit down and just follow the wheels."
Saturday's 20th and penultimate stage is a 181km run from Moralzarzal to Puerto de Navacerrada through the Guadarrama range north of Madrid. It includes five climbs which will give Evenepoel's rivals one last chance to attack.
"I think tomorrow will be a very crazy day," said mountains classification leader Richard Carapaz of Ineos.
Sunday's final stage is a short, flat ride into Madrid.
Meanwhile Roglic, the three-time defending Vuelta champion, on Friday blamed Wright for his crash.
Barely 100m from the line on Tuesday, Roglic, sprinting for victory and bonus points, made contact with Wright, lost control at high speed, smashed onto the tarmac and suffered injuries that forced him to abandon.
"This was not okay," Roglic said in an interview published on the web site of his Jumbo-Visma team.
"The way this crash happened is unacceptable," Roglic said.
"The crash was not caused by a bad road or a lack of safety but by a rider's behaviour. I don't have eyes on my back. Otherwise, I would have run wide. Wright came from behind and rode the handlebars out of my hands before I knew it."
Roglic said he felt "slightly better" on Friday morning.
He would not say if he thought he would race again this season.
"I can walk a little bit I am happy with that for the moment".
As marks of respect following the death of Queen Elizabeth II, riders paused at the start line for a minute and the British-based Ineos team wore black armbands.
STAGE 19 RESULTS
1. Mads Pedersen (DEN) Trek - Segafredo 3:19:11
2. Fred Wright (GBR) Bahrain Victorious "
3. Gianni Vermeersch (BEL) Alpecin - Deceuninck "
4. Ben Turner (GBR) INEOS Grenadiers "
5. Mike Teunissen (NED) Jumbo - Visma "
6. Jonas Koch (GER) BORA - hansgrohe "
7. Omer Goldstein (ISR) Israel - Premier Tech "
8. Raúl García (ESP) Equipo Kern Pharma "
9. Miguel Ángel López (COL) Astana - Qazaqstan Team "
10. Dylan van Baarle (NED) INEOS Grenadiers "
11. Marco Brenner (GER) Team DSM "
12. Chris Harper (AUS) Jumbo - Visma "
13. Jan Polanc (SLO) UAE Team Emirates "
14. Carlos Rodríguez (ESP) INEOS Grenadiers "
15. Davide Villella (ITA) Cofidis "
16. Nélson Oliveira (POR) Movistar Team "
17. Luis León Sánchez (ESP) Bahrain Victorious "
18. Harold Tejada (COL) Astana - Qazaqstan Team "
19. Richard Carapaz (ECU) INEOS Grenadiers "
20. Sam Oomen (NED) Jumbo - Visma "
1. Remco Evenepoel (BEL) Quick-Step - Alpha Vinyl 73:18:23
2. Enric Mas (ESP) Movistar Team +2:07
3. Juan Ayuso (ESP) UAE Team Emirates +5:14
4. Miguel Ángel López (COL) Astana - Qazaqstan Team +5:56
5. Carlos Rodríguez (ESP) INEOS Grenadiers +6:49
6. João Almeida (POR) UAE Team Emirates +7:14
7. Thymen Arensman (NED) Team DSM +8:09
8. Ben O'Connor (AUS) AG2R - Citroën Team +9:34
9. Rigoberto Urán (COL) EF Education - EasyPost +9:56
10. Jai Hindley (AUS) BORA - hansgrohe +12:03
11. Louis Meintjes (RSA) Intermarché - Wanty - +13:53
12. Jan Polanc (SLO) UAE Team Emirates +19:03
13. Alejandro Valverde (ESP) Movistar Team +24:31
14. Richard Carapaz (ECU) INEOS Grenadiers +28:46
15. Wilco Kelderman (NED) BORA - hansgrohe +30:27
16. Tao Geoghegan Hart (GBR) INEOS Grenadiers +40:36
17. Mikel Landa (ESP) Bahrain Victorious +42:33
18. Luis León Sánchez (ESP) Bahrain Victorious +43:41
19. Thibaut Pinot (FRA) Groupama - FDJ +45:00
20. Gino Mäder (SUI) Bahrain Victorious +47:19