In a match that started in August and finished in September due to the kickoff at 11 p.m. local time (2100 GMT), Villarreal were far more threatening than their Pamplona-based hosts and took the lead through Jeremy Perbet in the 23rd minute.
It was the first time Villarreal had won their opening three games of a top-flight season and lifted them to the top of the standings on nine points.
Celta Vigo failed to make their superiority count in a 1-1 draw at home to Granada, while Real Valladolid earned their first points of the campaign with a 1-0 victory against visiting Getafe in earlier games.
Barcelona coach Gerardo Martino has rested Xavi and Alexis Sanchez for the Spanish champions' game at Valencia on Sunday (1900 GMT) but Lionel Messi is back in the squad after missing last weekend's 1-0 win at Malaga with a bruised thigh.
Real Madrid host Athletic Bilbao in Sunday's early kickoff (1000) before Atletico Madrid visit fellow Champions League participants Real Sociedad at San Sebastian (1700).
Barca, Atletico, Bilbao and Real were the only other teams apart from Villarreal to win their opening two games.