Breaking clear up the final tortorously steep climb of the Murgil Tontorra, which features pinches at 22 per cent gradient, Kwiatkowski was able to rely on his teammate Mikel Landa to keep the race together and hold off the chasing peloton into the final sprint.
After the taking the victory in Basque country, an elated Kwiatkowski reflected on his win.
“It's a great day," the former world champion said. "Winning this race this way was a dream for me.
"I'm very grateful to my team-mates. Landa played a crucial role and I want to thank him for waiting in the final.
“We took the responsibility from the beginning. We believed from the start that we could win and it's a pleasure to come here because it's a beautiful city with amazing fans."
Kwiatkowski had been one of the most valuable domestiques during the Tour de France, spending long periods on the front of the race chasing down moves and setting the tempo for eventual winner Chris Froome. The Polish star was allowed his own shot at glory in the Spanish semi-classic and made the most of his opportunity to act as the team leader.
“I didn't know how I’d feel after the Tour de France," said Kwiatkowski. "I took some rest last week so I could prepare myself for this race.”
As it happened
The hilly 231 kilometre race kicked off under clear conditions in San Sebastian, with a seven-rider escape going clear early. Sven Erik Bystrom (Katusha-Alpecin), Jon Inxausti (Bahrain-Merida), Mickaël Delage (FDJ), Imanol Erviti (Movistar), Christophe Pfingsten (Bora-Hansgrohe) and the Cofidis pair of Loïc Chetout and Matthias Le Turnier formed the main break of the day.
The riders tackled the early climbs of the day, the Meaga, Iturburu and Alkiza climbs, whilst the pack allowed the break to push the gap up to a maximum of five minutes before their advantage stabilised at around four and a half minutes.
The gap was down around two minutes with 70 kilometres to go and local rider Erviti decided to chance a solo move off the front of the break. Before long, his six former breakaway companions were swept up. The Spaniard made it up and over the second ascent of the Jaizkibel but was caught before the second passage of the Arkale climb.
The short but challenging Arkale saw splits opening in the peloton, and Gianni Moscon (Team Sky) found himself well-placed in a small group off the front with around 25 kilometres to go. He seized the opportunity to jump clear by himself, leaping out to an advantage of 30 seconds before the chasing peloton gradually pulled him back, making the catch with 10 kilometres to race.
Sky kept firmly on the front foot, with Nieve attacking again almost immediately. He too was brought back as the summit loomed.
The steep ascent quickly strung out the peloton, opening the door for Landa to shoot off the front. Only Gallopin and Mollema could follow.
The trio opened a gap going over the top with Kwiatkowski and Dumoulin coming together in pursuit as pre-race favourites like Greg Van Avermaet (BMC Racing), Simon Yates (Orica-Scott), Warren Barguil (Team Sunweb) and Rigoberto Urán (Cannondale-Drapac) found themselves distanced in a larger group of around 20 riders.
With his fast-finishing teammate attempting to bridge, Landa eased off the throttle in the lead trio, and three became five with around five kilometres left to chase.
From there Landa pulled on the front of the five-man group to keep the peloton at bay, while Kwiatkowski sat on the back, preparing for the sprint, which he duly won.