On 15 January 2017, Ramos scored an own goal late in the game against Sevilla which equalized the score at 1–1 and eventually Real Madrid lost the match 2–1 in stoppage time, thus ending their unbeaten streak at 40 matches. A week later, he scored both goals in a 2–1 win over Málaga, registering his 50th goal in La Liga. On 11 February, in a 3–1 victory against Osasuna, Ramos played his 500th match with the club. In the UEFA Champions League round of 16 second leg, Ramos scored an important equalizing header against Napoli in a 3–1 away win as Real Madrid qualified to the quarter-final after winning 6–2 on aggregate. On 12 March, Ramos scored another late header winner for Real Madrid, this time against Real Betis at the Santiago Bernabéu in a 2–1 win, taking his goal tally to 10 for the season – scoring double digit goals in a season for the first time in his career. Ramos' winner put Real Madrid back at the top of the La Liga table. On 23 April, Ramos was sent off for the 22nd time in his Real Madrid career and fifth time in an El Clásico, after a straight red card for a two-footed challenge on Lionel Messi during a Barcelona counter-attack in their 3–2 home defeat. Real Madrid won their 33rd La Liga title, giving Ramos his fourth league title overall and first as captain. They went on to win their first league and European Cup double since 1957–58 season, as the team defeated Juventus in the 2017 UEFA Champions League Final. This also made Ramos the first player to captain a team to back-to-back European Cups in the UEFA Champions League era. His ten goals in 2016–17 made it his then-highest scoring season.