The No. 1-seeded Murray came into the tournament dealing with a sore left hip and it clearly impeded him at Centre Court. He grimaced as he stumbled or landed awkwardly while attempting shots.
Querrey took full advantage to reach the first Grand Slam semifinal of his career — and the first for any American man since Andy Roddick was the runner-up at Wimbledon in 2009.
"I am still in a little bit of shock myself," Querrey said.
There was another quarterfinal surprise later Wednesday, when three-time Wimbledon champion Novak Djokovic stopped playing because of a right arm injury while trailing 2010 runner-up Tomas Berdych of the Czech Republic 7-6 (2), 2-0. After dropping the opening set, Djokovic took a medical timeout while a trainer massaged his arm. A day earlier, during his fourth-round match, Djokovic had his right shoulder worked on by a trainer.
In Friday's semifinals, Querrey will face 2014 U.S. Open champion Marin Cilic of Croatia, who also won a five-setter Wednesday, getting past 16th-seeded Gilles Muller 3-6, 7-6 (6), 7-5, 5-7, 6-1 with the help of 33 aces. On the other half of the draw, Berdych will face Roger Federer or Milos Raonic next.
Murray is normally a terrific returner, but Querrey hit 27 aces, including on six of the last nine points he served to finish with a flourish. Querrey was impeccable for portions of the match, finishing with 70 winners and only 30 unforced errors.
"He was dictating all of the points," Murray said.
From 1-all in the fourth, Querrey grabbed eight games in a row to take that set and lead 3-0 in the last.
"I didn't start my best, but I just kept with it. Kept swinging away and then really found a groove in the fourth and fifth set," Querrey said. "And everything kind of seemed to be falling my way then."
It is the second year in a row that the 29-year-old Californian upset the defending champion and top-seeded man at the All England Club. In 2016, he beat Djokovic in the third round en route to the only major quarterfinal of Querrey's career before Wednesday.
That snapped Djokovic's 30-match winning streak at the majors. Murray didn't have that sort of recent dominance, but he is a three-time major champion and had been to at least the semifinals at the All England Club in seven of the past eight years.
The hip, though, was a problem. Murray had to skip some practice sessions and pull out of a couple of planned exhibition matches in the leadup to Wimbledon. Even though he kept insisting once the tournament began that he was OK, he was not nearly capable of his best on this afternoon.
Murray's serve speeds slowed, and his backhand didn't have its usual verve. One key to his success is his court coverage, which allows him to play defense as well as anyone. That was not the case in the latter stages against Querrey.
"I was pretty close today. It wasn't like I was, like, a million miles away from winning the match," Murray said. "Obviously the end was a bit of a struggle."
Querrey is the lowest-ranked player to beat two-time Wimbledon champion Murray in his 12 appearances at the grass-court Grand Slam tournament.
For Murray, this was the fourth five-set match he's lost in a row. Querrey is headed in the opposite direction: Merely 4-10 in fifth sets for his career until last week, he has won each of his last three matches by going the distance: against 12th-seeded Jo-Wilfried Tsonga in the third round, Kevin Anderson in the fourth, and now Murray.
Querrey always has had an intimidating serve, but he's never managed to put together his overall game for enough matches to play on the final weekend at a major.
Indeed, until last year's win over Djokovic, he might have been best known for some of his unusual off-court episodes. In Thailand for a 2009 tournament, he cut two muscles in his right arm when he sat on a glass table that shattered. Two years ago, he appeared on the reality TV show "The Millionaire Matchmaker." There's a popular video clip on social media of Querrey — sunglasses and hat on, shirt unbuttoned — dancing with friends wearing horse-head masks.
Now Querrey's on-court accomplishment Wednesday will make headlines. Win two more matches, and he'll be the Wimbledon champion.