Australia attacker Robbie Kruse's Bayer Leverkusen twice squandered the lead before slumping out of the German Cup second round 4-3 on penalties at newcomers to the third-tier Sportfreunde Lotte.
Lotte were down to 10 men from the 79th minute with the score at 1-1 on Wednesday but refused to buckle and snatched a memorable victory after the game finished 2-2 following extra time.
Kruse started the match and was substituted in the 74th minute.
UEFA Champions League club Leverkusen, who have slipped to 11th in the Bundesliga after losing their past two matches, were desperate to beat a side who stunned Werder Bremen in the previous round.
Leverkusen coach Roger Schmidt had to watch the match on a tablet from the team bus after being banned for two matches on the weekend for a verbal attack on his Hoffenheim counterpart in their 3-0 home league loss.
Leverkusen, who named an almost full-strength starting XI, drew first blood after 26 minutes when Kevin Volland fired home despite the attentions of two defenders.
The visitors were lucky to keep the lead when a Lotte effort was controversially ruled offside minutes later, but the hosts scored right after the break when Leverkusen's Roberto Hilbert, completely alone, deflected a harmless cross into his own goal.
Lotte's Tim Wendel was then sent off before Volland struck again in the first half of extra time with a close-range volley.
However, the home side refused to give up and came back once more through Kevin Freiberger's equaliser before keeping their cool to claim a famous victory in the penalty shootout.