On 29 May 2017, Valverde replaced Luis Enrique as the new Barcelona manager. His spell began with defeat as rivals Real Madrid won both legs of the Spanish Super Cup at the season's outset. However, the team then went on a 29-match unbeaten run in all competitions from 20 August 2017 until 17 January 2018, when they lost to Espanyol in the first leg of the quarter-finals of the Spanish Cup (also the club's first defeat at the RCDE Stadium, home of their neighbours, since its 2009 opening). They recovered to progress in that tie as part of another sequence of 15 matches without defeat, before a loss to A.S. Roma in the quarter-finals of the UEFA Champions League on 10 April, with the 3–0 defeat meaning the Italians progressed on the away goals rule.