Mark Uth scored twice as Hoffenheim beat Bundesliga champions Bayern Munich 2-0 at the Rhein-Neckar-Arena
Bayern coach Carlo Ancelotti had rotated his squad, with one eye on next week's Champions League opener against Anderlecht.
However, after Robert Lewandowski saw an early effort clip the woodwork, it was the hosts who stepped things up as Uth made the most of a quickly-taken throw-in to open the scoring after 27 minutes.
Uth later finished off a fine team move to double Hoffenheim's lead five minutes into the second half.
Despite sending on Arjen Robben, James Rodriguez and Franck Ribery for the closing stages, Bayern could not find a way back into the match.
They had almost taken the lead in the eighth minute when Lewandowski arrived to meet a cross into the box from the left and clipped the ball onto the angle of post and crossbar.
Hoffenheim, though, took the lead with a controversial effort from Uth.
Germany defender Mats Hummels hooked the ball out and down field, expecting play to be held up. However, Andrej Kramaric collected another ball off the ball boy to take a quick throw-in as referee Daniel Siebert waved play on.
Uth got ahead of Hummels, who was caught out of position, and raced into the penalty area before slotting his shot into the bottom corner past Manuel Neuer.
Bayern were beaten 1-0 by Hoffenheim in a rare Bundesliga defeat last season -- the hosts' first-ever victory in 18 meetings.
The champions looked to make a quick response, but Lewandowski's free kick was just wide. At the other end, Neuer had to be alert to save Steven Zuber's effort, which looked set for the bottom-right corner.
Bayern threatened again at the start of the second half when Kingsley Coman flashed a drive just over.
Hoffenheim, though, found themselves 2-0 up after 51 minutes. The ball was worked out to Zuber down the right side of the Bayern penalty area and he cut a pass back to Uth, who clipped a low shot past Neuer and inside the near post.
Bayern coach Ancelotti sent on Dutch winger Robben in an attempt to inject fresh life into his front-line.
With 20 minutes left, Lewandowski forced a fine reaction save from Oliver Baumann before at the other end Eugen Polanski flashed a shot just wide of the right-hand post.
Uth was forced off with an injury, while Bayern made more changes when on-loan Real Madrid playmaker Rodriguez replaced Thomas Muller and French forward Ribery came on for Rafinha.
The Colombian almost had an instant impact when his free-kick was headed goalwards by Javi Martinez, but Baumann produced another decent save.
Despite continuing to press during five minutes of added time, Bayern could not conjure a dramatic finale as Hoffenheim moved level on points with Borussia Dortmund and Hannover at the top of the table.