Nishikori also withdrew from last year's Wimbledon in the second round with a left calf injury
Japanese fifth seed Kei Nishikori pulled out of Wimbledon mid-way through his last 16 match against Marin Cilic on Monday, suffering from a rib injury.
An off-colour Nishikori consulted the trainer and doctor during the fourth round contest on Court Two and finally retired from the match at 6-1, 5-1 down.
He confirmed it was the same injury which forced him out of the Halle tourament in the run-up to Wimbledon.
"It got worse after the second round. I couldn't compete today," said Nishikori.
Croatian ninth seed Cilic now faces either seven-time champion Roger Federer or Steve Johnson of the United States in Wednesday's quarter-finals.
Nishikori's troubles were evident during the first set, when he found himself 5-0 down within 10 minutes, having won just two points as Cilic hit 10 aces.
The Japanese did win one service game but by the end of the 16-minute set, he had hit just two winners to 18 from his opponent.
He did manage to break Cilic early in the second set but could not stop the slump.
In the breaks of play, 26-year-old Nishikori looked forlorn, with his head down, staring at the ground.
He had his head in his hands after serving a double fault to go 4-1 down in the second set, after which his coaching staff -- including former French Open champion Michael Chang -- pleaded with him to call it quits.
Nishikori called for the trainer and the doctor and was given some pills.
After one more game he shook hands with his opponent.
Nishikori hit just five winners in the match to 28 from Cilic, and his fastest serve was at only 103 miles per hour. He had managed to get just 35 per cent of his returns in play.
Nishikori also withdrew from last year's Wimbledon in the second round with a left calf injury.
He was bidding to reach the Wimbledon quarter-finals for the first time in seven attempts -- the only one of the four majors where he has yet to make the last eight.
Nishikori was bidding to become only the second Japanese man to reach the Wimbledon quarter-finals, after Shuzo Matsuoka in 1995.
He was the last Asian player left in the tournament after compatriot Misaki Doi was beaten in the women's last 16 by Australian Open champion Angelique Kerber in the preceding match on the 4,000-seater Court Two show court.
Cilic, who beat Nishikori in the 2014 US Open final, has now reached the Wimbledon quarter-finals three times in a row, while Monday was the second time Nishikori had made it to the last 16.