The world number one, bidding for a fourth Wimbledon title and 13th major, suffered his earliest loss at a Slam since the 2009 French Open.
Federer backs Djokovic to escape early Wimbledon exit
The 7-6 (8/6), 6-1, 3-6, 7-6 (7/5) defeat, played out after an overnight suspension and two further lengthy rain interruptions, also ended Djokovic's Open era record run of 30 successive wins at the majors and his streak of having reached 28 consecutive Grand Slam quarter-finals.
American 28th seed Querrey, the world number 41, goes on to face 34-year-old Frenchman Nicolas Mahut for a place in the quarter-finals.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ