They were 171 riders at the start on a hot day in the Basque country and the day's breakaway took shape at kilometre 19 with the following 12 riders -- Michael Gogl (Tinkoff), Danilo Wyss (BMC), Gatis Smukulis (Astana), Tom Stamsnijder (Giant-Alpecin), Sergey Lagutin (Katusha), Jelle Wallays (Lotto Soudal), Yves Lampaert (Etixx-Quick Step), Vegard Stake Laengen (IAM Cycling), Valerio Conti (Lampre-Merida), Stephane Rossetto (Cofidis), Cesare Benedetti (Bora-Argon18) and Romain Cardis (Direct Energie)
Lagutin was first at the top of the Alto Monte Igualdo (km 99) and Cardis won the intermediate sprint in San Sebastian (km 110) before the fugitives' lead exceeded 20 minutes while the peloton was being led by Movistar.
Lagutin was again first at the top of the Alto de Aritxulegi (km 130.4) and the Alto de Agiña (km 139), the second and third of four third-category climbs of the day. The Russian made sure he would wear the polka dot jersey on Saturday by also reaching the Puerto de Lizaieta (163.2) first.
The stage was too much to handle for Zico Waeytens (Giant-Alpecin), who abandoned some 60 km from the finish.
After an unsuccessful attempt by Rossetto, Wallays attacked the front group with just under 30km left and he was only followed by Gogl. The two are being caught 22.5km from the line. After several foiled attacks, Laengen, Wyss, Conti, Lagutin, Gogl and Lampaert manage to break away from the group, only for the Italian to go solo with 19km left.
He never looked back, crossing the line with a 55-second advantage over Wyss and Lagutin, who were second and third espectively.
Saturday's 14th stage is a brutal 196-km mountain trek from Urdax-Dantxarinea to the col d'Aubisque, featuring four categorised climbs.
The peloton finished almost 34 minutes off the pace.