One year after knocking out 2015 champion Novak Djokovic in the third round, 29-year-old Querrey, the world number 28, won 3-6, 6-4, 6-7 (4/7), 6-1, 6-1.
World number one Murray's challenge petered out when he began limping off his right leg, his movement severely compromised by a recent hip problem.
"I knew I wasn't going to do any major damage by playing so I wanted to try and see if it was possible to find a way at the end," said two-time champion Murray, reluctant to dwell on his injury.
"It's disappointing to lose. It was an opportunity and I'm sad it's over."
More From This Section
Querrey will face Marin Cilic for a place in the final after the 2014 US Open champion defeated Gilles Muller, the conqueror of Rafael Nadal, 3-6, 7-6 (8/6), 7-5, 5-7, 6-1.
"I'm still in a state of shock. I'm glad I hit that last serve in," said Querrey who finished with 27 aces and 70 winners.
"I didn't start the best but I just kept swinging away and found my groove in the last two sets."
"It feels great. It's a dream come true to be in the semi-final at Wimbledon, it's very special," Querrey added.
There was no sign of the drama to come at the start of Wednesday's match.
Murray, 30, was supreme in the first set, carving out the key break for 2-0 and taking the opener on the back of just two unforced errors.
The Scot was a break to the good at 4-3 in the second before Querrey unexpectedly reeled off three straight games to level the quarter-final, firing 16 winners, twice as many as the top seed.
However, the champion's afternoon on Centre Court began to unravel as his movement became increasingly limited.
Limping badly off his right leg, Murray was being run ragged and was broken three times in a 22-minute fourth set.
- Federer, Djokovic eye blockbuster -
=====================================
The fifth set followed a similar plot line, lasting 27 minutes as Murray won just one point off the American's serve
Cilic reached his first Wimbledon semi-final having lost in the quarter-finals on his last three visits.
"It's an amazing achievement, three times I got stuck in the quarters," Cilic said.
The second of those encounters was the second longest match in Wimbledon history at five hours and 31 minutes, something Cilic doesn't want to experience again on Friday.
"Hopefully it's not the longest one ever," he said.
The other semi-final will see either seven-time champion Roger Federer or 2016 runner-up Milos Raonic tackle either Djokovic or 2010 runner-up Tomas Berdych.
Djokovic can reclaim the world number one spot from Murray if he goes on to win a fourth Wimbledon title on Sunday.
However, the 35-year-old Swiss star is wary of the sixth-seeded Canadian, who knocked him out in the semi-finals in 2016 in what proved to be Federer's last match of the season.
Federer leads Raonic 9-3 in head-to-head meetings and has reached his 50th Grand Slam quarter-final without dropping a set.
Raonic, runner-up to Murray last year, is bidding to make the semi-finals for the third time.
Djokovic takes a staggering 25-2 career record over Czech 11th seed Berdych into his quarter-final as he eyes a potential semi-final duel with Federer.
He also claimed a hole had opened up on the service line on the Centre Court.
"The courts are not great this year -- I've played on better courts," said Djokovic.
Berdych hasn't defeated Djokovic since 2013 but he did triumph over the Serb at Wimbledon in the semi-finals seven years ago when the Czech finished runner-up to Nadal.