He will play Britain's unseeded Kyle Edmund in an unexpected semi-final match-up on Thursday.
The Croat played in his first Australian semi-final eight years ago when he lost to Murray and it will also be his fifth Grand Slam semi-final.
Nadal was leading two sets to one before he called for the trainer and received a medical timeout trailing 1-4 in the fourth set.
He received treatment for an upper right leg injury and upon resuming his mobility was greatly affected and he lost the fourth set before calling an early end after losing a service break at 0-2 in the fifth.
"It was an unbelievable performance from the both of us and it is really unfortunate for Rafa, he's an unbelievable competitor, always gives his best and it's very unfortunate to finish this way for him," Cilic said.
"When you are wounded, sometimes the balls are going in, you are a little bit looser, so I was really paying attention to these first couple of games, just try to keep my intensity up.
"Overall I had a lot of chances there to break and somehow just Rafa was coming with some good serves, good shots in critical moments.
"That's the way he has always been, always finding the way, even if he is not playing at his best level."
Before Nadal's setback it had been a match of high quality, with Nadal edging ahead after a fluctuating third set tiebreaker.
Cilic, last year's Wimbledon finalist, was taken to seven deuces before he held to 3-3 in the opening set, but was broken in his next service game as Nadal claimed the opening set in 52 minutes with a forehand winner.
Cilic was incensed to receive a time violation warning while serving down two break points and came up with a double-fault for a break at 2-3 in the second set.
But the Croat reeled off two service breaks and levelled the match 6-3 with an ace.
Nadal won a mighty tussle for the third set lasting 72 minutes which went to a tiebreaker.
The world No.1 held set point at 5-4 before Cilic held and in the tiebreaker a couple of Cilic misses gave Nadal his second set point which he took with an ace.
But Cilic would not be denied and he broke Nadal's serve in the fourth game of the fourth set, racing to a 4-1 lead.
Nadal took a rare medical timeout to seek treatment for his injury before resuming, but with difficulty.
Cilic broke him a second time to take the match into a fifth set but with Nadal noticeably limping between points, the Spaniard eventually walked to the umpire and conceded.