Berlin (AFP) – Germany defender Mats Hummels has formally completed his transfer back to Bayern Munich from Borussia Dortmund by signing a five-year contract for the Bavarian giants on Monday.

The 27-year-old Borussia Dortmund captain finally put pen to paper and his transfer has reportedly cost Bayern 38 million euros ($42.5m).

Both clubs had confirmed the deal on May 10, when Bayern splashed out a reported 73 million euros in one day by signing Hummels and Portugal teenager Renato Sanches from Benfica.

Dortmund have made a fortune on the deal having originally paid Bayern four million euros for the World Cup winner back in 2008.

“We are pleased to welcome Mats back at Bayern,” said Bayern chairman Karl-Heinz Rummenigge in a statement.

“With his signing, we have not only a defender of world-class standing, but also a player who is not afraid to take responsibility and, moreover, comes from our academy.”

Hummels is the third big-name Borussia player to leave for Bayern in the last three years after Mario Goetze (2013) and Robert Lewandowski (2014).

Hummels had already completed his medical at Bayern, but held off on signing the deal in Munich until after Saturday’s German Cup final when Bayern beat Dortmund 4-3 on penalties.

“The departure from Dortmund was, of course, very difficult for me, like in 2008 when I made my way in the other direction,” he said.

“Now I’m just happy about everything that awaits me at Bayern.”

After Dortmund lost their third German Cup final appearance in a row last Saturday, Hummels explained why he had waited so long to sign the Bayern deal.

“I did not want to fly to Munich again, shortly before the game against Munich. That just didn’t feel good,” he said.