Substitute Mario Mandzukic scored twice as Bayern Munich beat Hertha Berlin 3-2 to extend their unbeaten run to 35 Bundesliga games.
Adrian Lopez gave Hertha an early lead, but 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 UEFA 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' 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. Ramos also thought he should have had a penalty for a push by Alaba in stoppage-time, but the referee waved play on and Bayern held on for another win.
|5||D. Van Buyten|
for T. Kroos 24'
for A. Robben 26'
for T. Müller 64'
|Wenger criticism baffles Redknapp|
|Leicester must strengthen in window - Walsh|
|United not title contenders - Docherty|
|Koeman: Southampton youngsters will get a chance|
|Dyche empathises with Liverpool striker crisis|
|Cagliari turn to Zola|
|Rooney thanks Van Gaal for Christmas break|
|Cruzeiro offer Paulinho Tottenham exit chance|
|Carlisle´s wife grateful to Burnley|
|Katebe called up to Zambia AFCON squad|
|Cape Verde name AFCON squad|
|Finke names much-changed Cameroon squad|
|Grant omits World Cup troublemakers for AFCON|
|Blackpool striker Ranger goes AWOL|
|Allardyce relishing Mourinho meeting|
|Ashley fails to increase Rangers stake|
|Crystal Palace v Southampton: Koeman calls for focus|
|Warnock targeting striker in January|
|Chelsea v West Ham: Adrian vows visitors will attack|
|Heskey signs short-term deal at Bolton|
|Everton v Stoke City: Martinez eyes strong form|
|Juninho defends David Luiz|
|Burnley v Liverpool: Dyche defends Rodgers ahead of Turf Moor test|
|Arsenal v QPR: Wenger eyes festive momentum|
|Liverpool are growing in confidence, says Rodgers|
|Redknapp: Austin future could depend on survival|
|Martinez wants Everton consistency|
|Barca want Neymar until 2020, says agent|
|Jones undeterred by pressure of Liverpool starting role|
|Allardyce ´knows how to beat managers´ - Carroll|
|Jones playing for a new contract|
|China select Evergrande spine for Asian Cup|
|A-League Preview: Koren tips City to build|
|Khedira keen to fight for Real spot|
|Southampton confirm Elia deal|
|Cellino to remain as Leeds owner until after appeal|
|Manchester United v Newcastle United: Van Gaal demands domination|
|Van Gaal refuses to dismiss Bale speculation|
|Sunderland v Hull City: Bruce sure of Hull revival|
|Swansea City v Aston Villa: Lambert optimistic of away success|
|Agbonlahor red rescinded|
|Falcao depends on team-mates to perform - Van Gaal|
|Monk dismisses talk of Gomis move|
|West Brom v Manchester City: Pellegrini to experiment again|
|Xavi: I was ready for New York switch|
|Ibrahimovic fumes at awards snub|
|Irvine: No approaches for Berahino|
|Pearson determined to revive Leicester fortunes|
|League Two Preview: First host third as Wycombe meet Luton|
|League One Preview: Buoyant MK Dons eye more glory, Bristol City seek response|
|Championship Preview: Pritchard plotting to end Ipswich run, Bournemouth host Fulham|
|Kaboul place not guaranteed by captaincy - Pochettino|
|Koeman hopeful of Elia deal|
|Atletico president not ruling out Torres return|
|Swansea secure Oliveira signing|
|No excuses for Pellegrini|
|Walcott pace unaffected by injury|
|Former Real Madrid star Roberto Carlos backs Ronaldo for Ballon d´Or|
|Former PFA chairman Carlisle ´stable´ after serious incident|
|Balotelli remorse saved him from longer ban|
|Bayern midfielder Martinez ´on track´ with rehab|
|Pardew ´overjoyed´ at Gutierrez return|
|Spurs confirm Yedlin to join in January|
|Zeman sacked by Cagliari|
|Casillas: I´m going nowhere|
|Bruce demands McShane apology|
|Pulis would welcome Brighton talks|
|Buffon: Juve angry after Supercoppa loss|
|Arteta out until new year|
|Rangnick: Kampl deserves Dortmund switch|
|PFA offers support to Carlisle after serious incident|
|Napoli can mount title bid - Higuain|
|Cech´s agent urges Liverpool and Arsenal to make bid|
|Hart happy to be back to his best|
|Terry thrilled with ´revelation´ Matic|
|Perez rues ´unfair´ Tyne-Wear derby result|
|Khalfan Ibrahim returns from injury|
|Magath slams ´sensitive´ Fulham|
|´Limited´ attacking options inspire Postecoglou´s selections|
|Carlisle reportedly involved in serious incident|
|Primeira Liga Review: Braga leapfrog Guimaraes|
|Hughes upbeat despite Stoke defeat|