Eden Hazard scored late in extra time to help 10-man Real Madrid rally to a 2-1 win over Elche in the round of 16 of the Copa del Rey on Thursday.

Elche took the lead moments after Madrid defender Marcelo was sent off late in the first half of extra time, but Isco Alarcón and Hazard scored in the second half to send Madrid into the quarterfinals.

More Images
Real Madrid's Eden Hazard, right, kicks the ball for scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Eden Hazard scored late in extra time to help 10-man Real Madrid rally to a 2-1 win over Elche in the round of 16 of the Copa del Rey on Thursday.

Real Madrid's Eden Hazard, center left, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Hazard himself thought he was offside and hesitated to celebrate at first but the goal was confirmed after a video review.

Real Madrid's Isco, left, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Madrid responded when Isco redirected a shot by Ceballos inside the area after being set up by Casemiro.

Real Madrid's Isco celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Elche was playing in the round of 16 for the first time since 2014-15.

Real Madrid's Eden Hazard, third right, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Defending Copa champion Barcelona later visits Athletic in a rematch of last year's final.

Real Madrid players celebrate their team victory over Elche at the end of the Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Getafe defeated Granada 4-2 at home for its third win in its last four Spanish league matches.

Referee shows a red card to Real Madrid's Marcelo, second right, during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Tales Azzoni on Twitter: http://twitter.com/tazzoni

Hazard, who hasn’t played much this season under coach Carlo Ancelotti, came on at the start of extra time and scored in the final minutes on a breakaway from near the midfield line. He picked up a pass by David Alaba and got around the goalkeeper before finding the open net for his first goal with Madrid since May.

Real Madrid's Eden Hazard, right, kicks the ball for scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Real Madrid's Eden Hazard, right, kicks the ball for scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Hazard himself thought he was offside and hesitated to celebrate at first but the goal was confirmed after a video review.

Gonzalo Verdú has scored for Elche with a shot from outside the area that fooled Madrid goalkeeper Andriy Lunin after deflecting on defender Dani Ceballos.

The goal came following a free kick that prompted the red card to Marcelo as he fouled a defender from behind to stop a counterattack. Madrid loudly complained against the call, claiming the Brazilian left back didn't touch the Elche player.

Real Madrid's Eden Hazard, center left, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Real Madrid's Eden Hazard, center left, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Madrid responded when Isco redirected a shot by Ceballos inside the area after being set up by Casemiro.

Elche thought it had equalized just before the final whistle but the goal was called back because of a foul on a defender inside the area.

Madrid is seeking its first Copa title since 2013-14. It was stunned by third-division club Alcoyano in the round of 16 last season while still under coach Zinedine Zidane. Madrid had last made it to the Copa quarterfinals in 2020.

Real Madrid's Isco, left, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Real Madrid's Isco, left, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Elche was playing in the round of 16 for the first time since 2014-15.

Madrid was coming off triumph in the Spanish Super Cup in Saudi Arabia, where it beat Barcelona in the semifinals and Athletic Bilbao in the final.

Ancelotti left three regular starters off the squad for Thursday’s game — goalkeeper Thibaut Courtois, defender Éder Militão and striker Karim Benzema, the team’s leading scorer this season. Gareth Bale returned following a long injury layoff but stayed on the bench.

Real Madrid's Isco celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Real Madrid's Isco celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Defending Copa champion Barcelona later visits Athletic in a rematch of last year's final.

The other teams to reach the quarterfinals are Mallorca, Cádiz, Rayo Vallecano, Valencia, Real Betis and Real Sociedad, which eliminated defending Spanish champion Atlético Madrid on Wednesday.

GETAFE MOVES UP

Real Madrid's Eden Hazard, third right, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Real Madrid's Eden Hazard, third right, celebrates after scoring his side's second goal during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Getafe defeated Granada 4-2 at home for its third win in its last four Spanish league matches.

The result moved the Madrid side to 16th place, four points from the relegation zone. Granada, which was coming off two draws, stay 14th.

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports

Real Madrid players celebrate their team victory over Elche at the end of the Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Real Madrid players celebrate their team victory over Elche at the end of the Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Tales Azzoni on Twitter: http://twitter.com/tazzoni

Referee shows a red card to Real Madrid's Marcelo, second right, during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)

Referee shows a red card to Real Madrid's Marcelo, second right, during a Copa del Rey soccer match between Elche and Real Madrid at Martinez Valero stadium in Elche, Spain, Thursday, Jan. 20, 2022. (AP PhotoAlberto Saiz)