Mario Gotze scored his first Bundesliga goal for Bayern Munich as the reigning champions beat Hertha Berlin 3-2 on Saturday afternoon.
Adrian Lopez gave Hertha an early lead, but Mario Mandzukic scored four minutes after replacing the injured Arjen Robben and then put the Bundesliga leaders in front with another header early in the second half.
Mario Gotze had come on just before the Croatia striker when Toni Kroos also picked up an injury and the midfielder made the most of his chance by scoring a third Bayern goal at the Allianz Arena.
Hertha were dangerous going forward and Anis Ben-Hatira pulled a goal back, but Pep Guardiola's side were not to be denied as they maintained their 100 per cent home record this season.
The victory ensured the European champions are just one game away from equalling Hamburg's 30-year record of 36 Bundesliga games without defeat and they were also boosted by the return of Javi Martinez, who came off the bench to make his first apperance for two months following a knee injury.
Mandzukic and defender Diego Contento dropped to the bench as Thomas Muller and Jerome Boateng returned to the starting line-up after being rested and suspended respectively for the midweek Champions League win over Viktoria Plzen.
There were two changes to the visitors' starting line-up following their win over Borussia Monchengladbach, as midfielder Tolga Cigerci and defender Nico Schulz were handed starts by coach Jos Luhukay.
And Luhukay's charges stunned Bayern just three minutes in, when the unmarked Ramos rose to meet Per Ciljan Skjelbred's corner and planted a header into the bottom-right corner of Manuel Neuer's net.
Things almost went from bad to worse for the European champions five minutes later, as Ben-Hatira's deft lob bounced down off the crossbar with Neuer beaten.
Bayern were struggling to get going until Gotze and Mandzukic replaced Kroos and Robben.
The Croatia striker took just four minutes to make his presence felt as he rose at the back post to head home Franck Ribery's free-kick.
Hertha continued to threaten and it needed a great challenge from Bastian Schweinsteiger to get across and ensure Cigerci's shot deflected over the bar.
Schweinsteiger then showed his class at the other end, six minutes after the break, as he delivered an inviting free kick, which Mandzukic met with a downward header into the far corner from 10 yards.
Kraft should really have done better and was beaten again three minutes later. This time Gotze was in the right place to head Rafinha's cross into the far corner as the Hertha keeper scrambled across in vain.
But Hertha were not finished yet and they were back in it on 57 minutes when Ben-Hatira diverted Ramos's mis-hit shot into the roof of the net.
Ramos was a thorn in Bayern's side and his long-range strike was tipped over by Neuer. He then appealed for a penalty for a push by Alaba in stoppage-time, but the referee waved play on and Bayern held on for another win.