Andrej Kramaric smashed home a stunner to become only the second team to claim victory over Bayern Munich this season.
Former Leicester man Kramaric let rip from 25 yards, catching Manuel Neuer cold, to give the hosts the lead after just 20 minutes.
Robert Lewandowski hit the crossbar for Bayern before the end of the break, but it was goalkeeper Oliver Baumann who was the hero for Hoffenheim.
He made a string of saves in the closing stages and helped his side secure their first-ever win over Bayern.
Borussia Dortmund are the only other team