Williams flicked Ibai Gomez's dangerous cross past goalkeeper Marc-Andre ter Stegen in the 93rd minute to send Athletic into the semifinals, where they join Real Sociedad -- who had earlier beaten Real Madrid -- Granada and second-division outfit Mirandes.
Ansu Fati had previously missed two early chances to open the scoring for Barca in the first half, while Frenkie de Jong, Antoine Griezmann and Lionel Messi all spurned openings after the break before -- with extra-time looming -- Athletic nicked the win.
Barcelona were poor in their recent defeat at Valencia in La Liga and moved toward an institutional crisis this week when captain Messi and sporting director Eric Abidal exchanged insults. However, despite all that, this was an encouraging performance, one that will breed hope for the coming weeks. San Mames is a tricky place to go (Barca lost there in similar circumstances on the opening day of the season), and they controlled the game for large parts of the evening. But for some poor finishing, they would have booked their place in the last four.
Barca's run of six consecutive Copa del Rey finals is finally over. It had to end sometime and now they will have to hope for success in La Liga and/or the Champions League if they don't want the campaign to end in complete failure. The nature of this defeat, coming so late in the day, will hurt.
There also will be concerns about Gerard Pique. The veteran defender went off injured in the second half, and new coach Quique Setien cannot afford any more fitness issues with only 16 first-team players available for this game in Bilbao.
Manager rating out of 10
6 -- There are signs of change under Setien. Barca are having more of the ball again and pressing more diligently. They must find a way to make more chances, though, and they must start taking them when they come their way.
Player ratings (1-10; 10 = best, players introduced after 70 minutes get no rating)
GK Marc-Andre ter Stegen, 6 - Has been taking more risks with the ball at this feet since Setien took over, but played a few poor passes against Athletic. Couldn't stop the goal.
DF Nelson Semedo, 7 -- Another bright performance, highlighted by a good chance he created for Fati in the first half.
DF Gerard Pique, 6 -- Defended well but his night ended when he lost a foot race with Inaki Williams, hauled him down, picked up his 15th booking of the season and got injured all at once.
DF Clement Lenglet, 6 -- A reliable presence alongside Pique. Less bold on the ball than Umtiti, but solid positionally.
DF Jordi Alba, 6 -- Got forward lots but struggled to make his final ball count. One of six Barca players booked (plus Setien) on the night -- for mouthing off at the referee.
MF Sergio Busquets, 6 -- Has been one of the most improved players under Setien and did well again at San Mames but was beaten by Williams for the winning goal. Playing with confidence again.
MF Frenkie de Jong, 6 -- Setien is asking him to play high up the pitch, presumably due to a lack of alternatives, and it doesn't suit him. That said, he found himself in some dangerous positions. Was booked for diving when one-on-one with the goalkeeper and should have had a penalty when he was pushed in the box minutes later.
MF Ivan Rakitic, 5 -- The one Barca player who was a little bit off the pace. Worked hard but didn't contribute much before being taken off.
FW Sergi Roberto, 6 -- "Mr. Versatile" returned to the team as the third forward, starting wide on the right to allow Griezmann a break. Created a great chance for the French forward when he came on, though.
FW Lionel Messi, 6 -- Missed a great chance to win the game in the final 10 minutes, shooting straight at Unai Simon when you would expect him to score 10 times out of 10.
FW Ansu Fati, 7 -- The liveliest Barca player in the first half, shooting wide early on and then seeing another effort cleared off the line. Taken off early in the second half, though, perhaps because of the number of minutes he has played in the past few weeks. Remember, he's still just 17!
FW Antoine Griezmann, 6 -- Missed a glorious chance shortly after coming on.
MF Arthur, 6 -- Played a lovely pass for the Messi chance, which the Argentine spurned.
DF Samuel Umtiti, N/R -- Was in court in the morning due to a dispute over damages at a previous household but was forced on unexpectedly when Pique got injured.