Berlin (AFP) – Struggling Hamburg pulled themselves out of the Bundesliga relegation places with a shock 3-0 win at home against Julian Nagelsmann’s Hoffenheim on Sunday.

An own-goal after just six minutes by Hoffenheim defender Kevin Akpoguma put the hosts ahead at Hamburg’s Volksparkstadion.

Midfieler Filip Kostic then drilled in a second-half free kick before defender Gideon Jung fired home late on for his first Bundesliga goal to wrap up Hamburg’s win.

It was only the third defeat this season for Hoffenheim, who finish the weekend seventh – out of the top six for only the second time this season.

It capped a bad week for Nagelsmann, voted Germany’s coach of the year in 2016, with his side out of the Europa League after Thursday’s defeat at Sporting Braga.

The win leaves Hamburg 15th, pushing Freiburg into the relegation places alongside Werder Bremen and bottom side Cologne, who later lost 2-0 at home to Hertha Berlin.

Bibiana Steinhaus took charge of her third Bundesliga match having become the first female to referee in any of Europe’s top leagues earlier this season. 

Hertha’s Bosnia striker Vedad Ibisevic scored both goals, tapping home on 17 minutes after Davie Selke’s header was saved and then converted a second-half penalty.

Pal Dardai’s Berlin earned their first away win this season and climbed three places to 11th.

Cologne failed to build on their shock 1-0 win over Arsenal on Thursday in the Europa League.

They have just two points from their first 13 league games and remain winless this season in the German league.

Hamburg’s win now leaves Cologne 11 points from safety with head coach Peter Stoeger clinging onto his job.

On Saturday, leaders Bayern Munich suffered their first defeat since Jupp Heynckes returned as head coach last month with a 2-1 defeat at Borussia Moenchengladbach.

A penalty converted by Thorgan Hazard and a Matthias Ginter goal left Gladbach 2-0 up at the break before Arturo Vidal scored a consolation goal for Bayern, who stay three points clear in the table despite the defeat.

There was an eight-goal thriller at Borussia Dortmund as the hosts threw away a four-nil lead in their 4-4 draw against Schalke in the Ruhr Derby.

Pierre-Emerick Aubameyang, Mario Goetze and Raphael Guerreiro all netted, while Schalke midfielder Benjamin Stambouli volleyed an own goal to leave Dortmund 4-0 up after 25 minutes.

But the second half was a totally different story.

Guido Burgstaller and Amine Harit clawed goals back for Schalke before the hosts had Aubameyang sent off in the 72nd minute for a second yellow card.

Borussia’s collapse was completed when Daniel Caligiuri blasted home to make it 4-3 before Naldo’s 94th-minute header delighted travelling fans and stunned the hosts as Schalke came back from the dead.

The result leaves Schalke third and Dortmund fifth, but winless in their last six league games.