 On 6 July 2018, 33-year-old Gavilán returned to Spain after agreeing to a two-year contract with AD Alcorcón in the second division.On 9 July of the following year, after appearing in only eight league matches, he terminated his contract.On 10 August 2019 UD San Sebastián de los Reyes announced, that they had signed Gavilán.