Rafael Nadal struggled with injury Tuesday at the Australian Open, retiring against Marin Cilic in the fifth set of their quarterfinal match.

Cilic was leading 3-6, 6-3, 6-7 (5), 6-2, 2-0 when Nadal decided to give in.

The No. 2 seed, Nadal came out in the fifth set hobbling and unable to move around the court.

He had been bothered by pain in his right knee late last season. The 31-year-old Spaniard was looking to add to his 16 Grand Slam singles titles in Melbourne.

Nadal received treatment on his upper right leg after the fourth set.

Cilic will play Britain’s Kyle Edmund in Thursday’s men’s semifinals.