Promoted Kaiserslautern stun champions Bayern
The hosts, playing in front of a sellout 49,780 crowd, struck against the run of play when Croatian midfielder Ivo Ilicevic hammered a brilliant shot from 20 metres in the 36th minute.
A minute later Ilicevic, who was sent off near the end for a second caution, turned provider to set up countryman Srdan Lakic who slotted his third goal in two matches.
Bayern, who won their opening game of the season, desperately tried to claw their way back in the second period but squandered half a dozen chances mainly through former Kaiserslautern striker Miroslav Klose, Ivica Olic and Toni Kroos.
"Over 90 minutes we were the better team and had better chances but it was just not meant to be tonight," Bayern defender Philipp Lahm told reporters.
Bayern, still missing winger Arjen Robben through injury but with Croat Olic back in the team, took control early on and missed a good chance when Thomas Muller sent the ball wide from 12 metres midway through the first half.
The visitors, though, were left with a mountain to climb after Ilicevic and Lakic struck.
"A key moment was Mueller's chance. We survived that and then we played with a lot of heart," said Kaiserslautern coach Marco Kurz.
The Bavarians deserved a goal in the second half but lacked the final touch as Kaiserslautern, who lost only twice at home in 17 matches last season, held on.
"We played well up until the final pass. Kaiserslautern though made space tight for us and had a lot of passion," said Bayern coach Louis van Gaal.