On 5 July 2019, Chavarría joined La Liga side RCD Mallorca on a free transfer, signing a two-year contract. On 28 September of the following year, after 15 goalless appearances as his side suffered relegation, he reached an agreement with the club over his contract termination, and joined Segunda División's Málaga CF on a one-year deal just hours later.