Pellegrini took over the managerial duties of Villarreal CF on 1 July 2004. In his first season in charge of the club, Villarreal qualified for the UEFA Champions League after finishing third in the league and reached the quarter-finals of the UEFA Cup. The following season, Villarreal reached the semi-finals of the 2005–06 UEFA Champions League, losing to Arsenal. Villarreal eventually finished seventh in La Liga that year. The following two seasons featured Villarreal finishing in both fifth and second place in the league, the latter being historic for the club. Pellegrini led "El Submarino Amarillo" to the Champions League knockout stages, where they drew Arsenal once again in the quarter-finals, losing 4–1 on aggregate.