Penalties from Gerard Moreno and Arnaut Danjuma and Pau Torres's tap-in in the final quarter of an hour were enough for Unai Emery's well-organised side to see off the Italians at the Allianz Stadium and make Friday's last-eight draw.
Villarreal stunned Juve with three sucker punches after spending most of the match on the back foot, content to hold off the hosts' attacks which got less potent as the match wore on.
An embarrassing defeat was just Juve's second since the end of November and punctures a dogged run of form which has put them back into the league title race at home.
They were loudly booed off by the home crowd who watched their team shrink from a promising start and bounce off a yellow wall before being bundled out of the competition.
Italy are now without a single representative in this season's Champions League as it moves into its later stages.