Yates (Mitchelton-Scott) had his lead trimmed by a few seconds as Alejandro Valverde (Movistar) edged closer to the overall lead, but the Mitchelton-Scott team leader's chances of overall victory remain good with one mountain stage to go.
An emotional Woods (EF Education First-Drapac) won in the mist on Balcon de Bizkaia in the Basque Country, seeing off the challenge of Dylan Teuns (BMC), who finished five seconds behind with David de la Cruz (Sky) third at 10 seconds.
“It’s a special moment for me. I was very moved on the finish line," Woods said. "There were so many people on the side of the road screaming my name.
"My coach was in the car and in the final 500 metres he told me on the radio to think about my family. My wife was pregnant for 37 weeks and we lost the kid. We were going to name him Hunter. My wife also lost her father one month ago. It’s been a very hard year. I was cracked on the finish line.
"I bluffed Dylan Teuns in the end, I thought I didn’t have so many metres to go when I accelerated and then I saw the sign for the 500 metres to go. I figured I still had two minutes of effort. I tried to stay calm,
"I tried to think of my family and to think of my little Hunter as an inspiration. This is also a special area for me. I love racing in the Basque Country. The fans are amazing.”
Yates conceded eight seconds to Valverde, who is now 25 seconds adrift overall with three stages remaining ahead of the finish in Madrid.
Two flat stages are scheduled for Thursday and Friday, so Yates' rivals' best and final hope to wrest the red jersey from his shoulders will come in Saturday's mountainous 20th stage, the 97.3km route from Andorra Escaldes-Engordany to Coll de la Gallina.
As Woods won the stage, accelerating away from Teuns, de la Cruz and Rafal Majka (BORA-hansgrohe), the general classification battle was unfolding behind them.
Yates, who gained seven seconds on Valverde on the Stage 16 time trial, lost contact with the 38-year-old on the final ramps of the brutal concluding climb.
“There’s still a lot of racing to come, hard stages ahead," Yates said. "The gaps are still small behind me. Nobody really attacked in the climb. My brother Adam was riding. Alejandro (Valverde) went at the beginning but we had the guys to cover his move with Jack (Haig) and Adam.
"Lopez went with 1.5km to go but again Adam closed him down. Alejandro opened his sprint and that’s where the gaps were created. My legs were similar than the day I won at Les Praeres. It was slightly longer and further in the race so it was more difficult.
"There’s no shame in losing a few seconds to Valverde and Mas in such a finale. I truly believe Andorran stages are much better for me. Of the stages left, this is the one I feared most. I know Andorra very well and I think the climbs suit me very well.
"Quintana will probably try to go early if he has the legs, so it makes my life more difficult. He lost one minute, it’s not that much. I’ll still be wary, I’ll be very careful but I’m obviously happy to gain time on him.”
Of the red jersey contenders, only Enric Mas (Quick-Step Floors) was able to stay with Valverde. Mas was 14th and Valverde 15th on the stage, with Yates 17th.
Steven Kruijswijk (LottoNL-Jumbo) and Nairo Quintana (Movistar), the 2016 winner, lost over a minute to Valverde as they finished together in 22nd and 23rd place, respectively.
Mas moved up from fifth to third as a result, one minute 22 seconds behind Yates. Miguel Angel Lopez (Astana) is now fourth, 1min 36secs behind, Kruijswijk fifth, 1:48 adrift, and Quintana 2:11 behind.
The race continues with Stage 18, a flat - yes, it's finally flat! - 186km run from Ejea de los Caballeros to Lleida.