Japan midfielder Shinji Kagawa scored his third goal of the season and Borussia Dortmund beat Schalke 3-2 in a pulsating derby in the Bundesliga on Sunday.

Kagawa got on the end of a delicious cross from Matthias Ginter to open the scoring with a rare header after 30 minutes.

"I have no memory of scoring (with my head) before," said Kagawa. "I was just focused on connecting with the cross."

Dortmund's lead did not last long though as Klaas-Jan Huntelaar leveled for the visitors in the 33rd after being teed up by Leroy Sane.

Ginter headed in a corner from Henrikh Mkhitaryan to restore Dortmund's lead two minutes before the interval and the home side went further ahead in the 48th when Gonzalo Castro put the third on a plate for Pierre-Emerick Aubameyang.

Huntelaar reduced the arrears when he pounced on an error by Mats Hummels to score with 18 minutes left but Dortmund hung on to take the three points.

"We were wobbling towards the end," said Kagawa, who singled out Ralf Fahrmann for praise after the Schalke keeper had kept his side in the game with a number of key saves.

"I think Ralf Fahrmann deserves a lot of praise, because he managed to stop a few huge chances that came our way," he told Bundesliga.com.

"It's important that we created a lot of chances, but the most important thing is to have won the derby. It was a special atmosphere and not many matches have this kind of tension."