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'
|Gutierrez, Taylor released by Newcastle|
|Figo calls on re-elected Blatter to resign after ´dark day´ for football|
|Szczesny blasts father over ´idiotic´ comments|
|Blatter vows to leave ´strong´ FIFA|
|Blatter re-elected as FIFA president|
|BREAKING NEWS: FIFA elections set for second round of voting|
|Atsu wings in for Bournemouth campaign|
|Klopp: Pokal final not about me|
|Clement says Real goodbyes|
|Inter v Empoli: Icardi looking for final flourish|
|BREAKING NEWS: Blatter - I will fix FIFA|
|Northern Ireland v Qatar: O´Neill keen to prepare for Romania test|
|Palestine drop proposal for Israel suspension|
|Suarez will only get better, warns Iniesta|
|Martinez keen to recruit quickly|
|Monk keen to build on successful Swansea campaign|
|Fit-again Suarez set to aid Barca´s treble quest|
|Anonymous ´bomb´ threat received at FIFA Congress|
|Qatar organisers insist World Cup bid met ´highest ethical standards´|
|Wilkinson and Sorensen leave Stoke|
|Blatter: You can´t ask everyone to behave ethically just like that|
|Van Bronckhorst positive about Feyenoord future|
|Australian police to look into FFA-Warner dealings|
|Dardai signs Hertha deal|
|Protester interrupts FIFA Congress|
|Spurs complete Wimmer signing|
|Warner questions charges following release|
|Mexico v Guatemala: Herrera´s men kick off Copa preparations|
|New Zealand no longer supporting Blatter|
|´Post-World Cup trauma´ affected Mertesacker|
|Racing Club 0 Guarani 0 (0-1 agg): Draw sees Paraguayans through|
|Hamburg shocked by Karlsruher attack - Labbadia|
|Serie A Preview: Napoli, Lazio eye Champions League|
|Hodgson will not overstay England welcome|
|Scholes: United must keep Di Maria|
|Leyton Orient appoint Hendon|
|Benteke has a buy-out clause - Sherwood|
|US Soccer will support Prince Ali in FIFA election|
|Dynamo disappointed with officials after City friendly abandoned|
|Calls for Suarez appeal gather momentum|
|Eredvisie Review: Vitesse denied by late Uth goal, NAC Breda boost survival hopes|
|Rangers 1 Motherwell 3: McCall´s men facing uphill struggle|
|Hamburg 1 Karlsruher 1: Bundesliga side escape with draw|
|Blatter vows to lead FIFA clear of trouble as corruption scandal rolls on|
|Bundesliga: Bayern Munich season review - League crown not enough to signal successful campaign|
|Genoa forced to wait for UEFA licence|
|Injured Cardozo out of Paraguay squad|
|CONCACAF provisionally dismisses Webb and Li|
|Klopp: Career highlights of a charismatic coach|
|Verona v Juventus: Ogbonna seeks strong Champions League warm-up|
|FA charges Demetriou over betting breaches|
|Atalanta v Milan: Inzaghi faces last chance to prove worth|
|King joins Bournemouth as QPR rebuild begins|
|Plymouth part ways with Sheridan|
|Hernandez banned for three matches|
|Chelsea star Fabregas has nose surgery|
|Blatter: More bad news may follow|
|Galliani hopeful over Ancelotti deal|
|Frontzeck to continue as Hannover coach|
|Tremmel released as Tate waves goodbye to Swansea|
|Arsenal v Aston Villa: Sherwood out to upset holders|
|UEFA open to boycott of World Cup - Platini|
|Porto activate release clause for Casemiro|
|Athletic Bilbao v Barcelona: Catalans seeking second leg of treble|
|Auxerre v Paris Saint-Germain: History beckons for Ligue 1 champions|
|Cole confirms West Ham departure|
|UEFA elect not to boycott FIFA Congress|
|Borussia Dortmund v Wolfsburg: Klopp aiming for triumphant farewell|
|Flamini hails Coquelin impact at Arsenal|
|South Africa deny wrongdoing in World Cup bid|
|Benitez confirms Napoli exit|
|McShane among six released by Hull|
|Cerci committed to Milan|
|West Ham expect Collins to return for pre-season|
|Real deny Pogba bid|
|Important to keep Chelsea squad together - Mourinho|
|Alonso: Gerrard was magic|
|Pochettino silent on Ings speculation|
|Visa threatens to ´reassess´ sponsorship amid FIFA scandal|
|Blatter skips FIFA Medical Conference|
|MLS Preview: Revs not out for revenge against Galaxy|
|MLS Review: Sounders go top in West, Timbers and Galaxy win|
|AFC stands by Blatter|
|Matheus ´alright´ after collapse - Markevych|
|Copa Libertadores Review: River, Inter through to semis|
|Signing Toni a ´long shot´ for Adelaide|
|Ramsey good enough for Barca - Coleman|
|Bacuna pushing for Benteke stay|
|Evans stunner settles City friendly in Toronto|
|Banega: Emery a great coach|
|Emery tight-lipped on Sevilla future|
|Argentina finalise Copa America squad|
|Nike issues statement following arrest of FIFA officials|