Federer did not have things all his own way against the Uzbek, who had the chance to break to lead 6-5 in the first set, but he could not take it and did not get another one, the world number one coming through 7-5 6-3.
Federer then returned to the court alongside Stanislas Wawrinka, the man with whom he won an emotional and surprise Doubles gold in Beijing.
They raced through the first set against experienced Israeli pair Jonathan Erlich and Andy Ram but could not close it out and were beaten 1-6 7-6 (7/5) 6-3.
Federer said: 'I'm disappointed but overall I'm feeling good. Best-of-three-set tennis is very fast. There is no room for error really. In the Doubles, even more so. I think we played two good Doubles matches and I'm playing well in the singles.'
Federer will take 6ft 9in USA player John Isner in the quarter-finals after he ended the hopes of Serbian seventh seed Janko Tipsarevic, surviving a titanic tie-break to win 7-5 7-6 (16/14).
Second seed Novak Djokovic was pushed all the way by a rejuvenated Lleyton Hewitt, but he dug in and eventually triumphed 4-6 7-5 6-1 in a high-quality match.
Djokovic said afterwards: 'I think he plays his best tennis on grass. He's a former world number one. I have a lot of respect for him. He's a great competitor.'
Things certainly do not get any easier for Djokovic, who next faces a blockbuster quarter-final against fifth seed Jo-Wilfried Tsonga.
The Frenchman recovered impressively from his titanic battle against Milos Raonic yesterday, which went to 25-23 in the third set, to defeat Spain's Feliciano Lopez 7-6 (7/5) 6-4.
There was a late-night shock as Japan's Kei Nishikori defeated fourth seed and Wimbledon quarter-finalist David Ferrer of Spain 6-0 3-6 6-4.
In the quarter-finals he will face eighth seed Juan Martin Del Potro from Argentina, who defeated France's Gilles Simon 6-1 4-6 6-3, while 11th seed Nicolas Almagro was a 7-5 6-3 winner over Steve Darcis and next meets Andy Murray.