Villarreal scored three late goals to move into the Champions League quarter-finals as Juventus went out in the last 16 for a third successive year.
The Spanish side did not have a shot on target before substitute Gerard Moreno converted a 78th-minute penalty after Daniele Rugani fouled Francis Coquelin.
Defender Pau Torres added a second when he finished from six yards as Juventus failed to deal with a corner.
Arnaud Danjuma made it 3-0 with another penalty after Matthijs De Ligt handled.
"We had a gameplan and knew there'd be tough moments," said Villarreal boss Unai Emery.
"Whoever we get in the draw will be a top side, just like the one we faced."
The draw for the quarter-finals takes place on Friday and Villarreal will be in the last eight of the competition for the first time since 2008-09 and only the third time in their history.