The Pole showed a great turn of speed at the finish in Donostia, winning the reduced bunch sprint for the runner-up spot, three seconds back on solo stage victor David De La Cruz (Quick-Step Floors).
On a tough and undulating stage Kwiatkowski had been moved into a great position ahead of the final climb. Vasil Kiryienka strung out the pace over the Mendizorrotz, thinning out the bunch.
De La Cruz launched a brave attack and held on to win the stage, while Sergio Henao dug deep on the final run-in to help limit the Spaniard's advantage. The Colombian champion joined Kwiatkowski, Mikel Nieve and Sebastian Henao in the elite 40-rider group.
With overnight leader Michal Matthews (Team Sunweb) dropped on the last of the day's six categorised climbs, the yellow jersey now switches to De La Cruz. With no bonus seconds on offer in the Basque Country, another consistent stage placing saw Kwiatkowski elevate himself to fourth overall.
With 160.5km on the agenda, Team Sky helped share the pace setting duties with Movistar for much of the day, with David Lopez to the fore on the first-category Santa Ageda.