Juanito soon attracted the attention of Real Madrid, which signed the player in June 1977. He became a prominent member of the successful Real side during the late 1970s and 1980s, in a squad which also featured Santillana, Uli Stielike, Vicente del Bosque and José Antonio Camacho. Having scored ten goals in his debut season he was instrumental in helping the capital team to five league titles, two Spanish Cups and two UEFA Cups – among his personal highlights were netting twice in the 1980 domestic cup final, incidentally played against Castilla CF, the club's reserves (6–1). On 11 May 1983 he scored through a penalty in the European Cup Winners' Cup final, a 1–2 loss against Aberdeen, and, in the subsequent league campaign, he won the Pichichi Trophy after finishing as joint top goalscorer with 17 goals; during ten seasons with the "Merengues" he played 284 first division games and scored 85 goals, adding 55 appearances in various European competitions (17 goals).