Bilbao win derby despite Martinez stunner
Centre-back Martinez let fly from inside the centre circle catching Gorka Iraizoz off his line, the visiting keeper perhaps distracted after one of his defenders had just been carried off on a stretcher, and the ball dipped under the crossbar.
Spain striker Llorente had put Bilbao ahead, turning in the area to score in the 34th minute, before Martinez levelled just past the hour mark in a sun-soaked San Sebastian.
Llorente then struck a superb volley to restore Bilbao's advantage in the 71st and earned under-pressure Argentine coach Marcelo Bielsa a first league win this season.
Bilbao climbed out of the bottom three to five points from six games, two behind their north-coast neighbours in ninth.