Bayern Munich, winners of the UEFA Super Cup against Sevilla after extra time on Thursday, had not lost since Dec. 7, 2019.
They had gone 21 consecutive Bundesliga matches without defeat, winning their last 15.
The European champions conceded two goals in eight minutes as their usually solid defence collapsed under Hoffenheim pressure.
Ermin Bicackcic put them ahead in the 16th minute and Manus Dabbur doubled the lead.
Joshua Kimmich cut the deficit with a superbly curled shot into the top corner in the 36th minute and Bayern Munich missed several good chances to level early in the second half.