The 30-times winners were upset by Athletic, while Real Sociedad stunned Real Madrid at the Bernabeu.
Spanish striker Williams buried a chance into the bottom corner to spark pandemonium at a lively San Mames stadium. The win brought back memories of Aritz Aduriz’s added-time goal in another 1-0 win over the Catalans on the first day of the Liga season.
They join fellow Basque club Real Sociedad along with Granada and second-tier Mirandes in Friday’s semi-final draw, which will not include Real Madrid, Barca or Atletico Madrid for the first time in 17 years.
The defeat piles on the pressure on Barca after a tough week where captain Lionel Messi hit out at sporting director Eric Abidal and forward Ousmane Dembele picked up another hamstring injury to end his season and leave Quique Setien with limited options.
Barca defender Gerard Pique said the team needed to show unity and refrain from in-fighting, adding that the performance, if not the result, proved that they had moved on from the saga.