Murray was hoping to warm up for his Wimbledon title defence by winning the Queen's title for a sixth time, but instead he succumbed to an astonishing 7-6 (7/4), 6-2 defeat against the world number 90.
The 30-year-old's loss was all the more remarkable because Thompson was only called up to face Murray at the last minute.
Murray was scheduled to face Aljaz Bedene, but he withdrew with a wrist injury just hours before Tuesday's match, leaving Thompson, who was at the west London venue as an alternate after losing in the qualifying rounds, to scramble to get ready for his unexpected date with destiny.
With the Queen's champion well below his best, 23-year-old Thompson seized his opportunity in memorable fashion and handed Murray his earliest exit from the tournament since 2012.