Xabi Alonso and Rafinha spared Bayern Munich's blushes as the reigning Bundesliga champions came from behind to beat Ingolstadt 3-1 in unconvincing fashion in the Bavarian derby on Saturday.
It was by no means a vintage display from Bayern, who were given plenty of problems by their visitors at the Allianz Arena before making it three wins from three in the league, but their superior quality ultimately saw them through in spite of a few nervy moments, with Rafinha's late strike eventually killing off Ingolstadt's chances.
The away side gave Bayern a bit of a scare when Dario Lezcano broke the deadlock early on, but Carlo Ancelotti's men looked unfazed and restored parity shortly after through Robert Lewandowski.
Ingolstadt remained a real threat with Lezcano and Mathew Leckie in attack, but Bayern ultimately went ahead through Alonso early in the second half, just before the Australian drew a crucial stop from Manuel Neuer.
The brilliant Lezcano and Leckie inspired another glorious chance that was spurned by Lukas Hinterseer and Ingolstadt were made to rue such wastefulness, as Rafinha secured their sixth successive win in all competitions, unconvincing though it was.
Early on Bayern looked like a team playing with the confidence that comes from scoring 20 goals in their last five competitive outings, attacking Ingolstadt right from the off.
However, the visitors were intent on giving their more illustrious Bavarian neighbours a shock, as Lezcano latched on to Leckie's pass into the left side of the area and prodded past Neuer eight minutes in.
But Bayern kept their cool and were level just four minutes later; Lewandowski racing on to Franck Ribery's intricate pass and cleverly lobbing Orjan Nyland in the Ingolstadt goal.
Bayern struggled to add to that, though, and Ingolstadt crafted the next opportunity nine minutes before the break, as Leckie and Lezcano combined on the edge of the area, with the Australian then blazing over from 16 yards.
Bayern looked more like their usual selves at the start of the second period and took the lead for the first time after 50 minutes.
After patient build-up play, Ribery flicked the ball to his right for Alonso and the Spaniard rifled a rasping drive into the left side of the goal from 25 yards.
That lead only remained intact a few minutes later thanks to a sensational save from Neuer, as the goalkeeper tipped Leckie's stinging effort over after the excellent Australian left the Bayern defence in knots.
Bayern were carved open again 22 minutes from time and Ingolstadt should have equalised, but Lukas Hinterseer inexplicably missed the target when one-on-one with Neuer following another clever move instigated by Lezcano and Leckie.
The hosts finally ended Ingolstadt's valiant fight six minutes from time, as Rafinha stabbed into the bottom-left corner following a Ribery pass, wrapping up all three points and a win that flattered the champions.