The Italians looked set for a third group stage appearance in four years when Marek Hamsik fired them into the lead just after half-time.

However, awful defending from Napoli presented Aritz Aduriz with two simple chances to put the Basques in front before Ibai Gomez sealed the tie with a calm finish.

Playing for the first time at the new San Mames since the stadium had been completed over the summer, Athletic had the better of the first-half and had two glorious chances to go in front.

Unfortunately for the Basques they fell to centre-backs Carlos Gurpegi and Aymeric Laporte as both missed the target with the goal gaping from two Benat Extebarria corners.

Athletic looked like they would rue those chances when Hamsik opened the scoring two minutes after the restart as the Slovakian pounced on a loose ball on the edge of the area before drilling the ball left-footed in off the post.

The hosts responded immediately and only a fantastic save from Rafael Cabral prevented left-back Mikel Balanziaga from a spectacular equaliser.

However, Athletic only had to wait a further 10 minutes to be level as Aduriz took advantage of some shocking marking to control another corner at the back post before slotting home.

And there was another defensive nightmare for the visitors eight minutes later as Rafael came flying off his line to allow Aduriz to roll the ball home into an empty net.

The third goal arrived in controversial circumstances as Aduriz was clearly in an offside position as he was played in, but he allowed Gomez to take over and round off a famous night in Bilbao with a low finish into the corner.

Athletic will now join three other Spanish sides, holders Real Madrid, Atletico Madrid and Barcelona, in Thursday's draw.