Hamburg's Filip Kostic, centre, celebrates after scoring the second goal against Hoffenheim on Sunday. Photo: Daniel Reinhardt/dpa via AP

BERLIN – 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 are at home to Hertha Berlin later on Sunday.

Cologne have just two points from their first 12 league games, but will be looking to build on Thursday’s stunning 1-0 win over Arsenal in the Europa League.