Borussia Dortmund have signed right-back Achraf Hakimi from Real Madrid on a two-year loan, keeping the Morocco international at the Westfalenstadion until the summer of 2020.

Hakimi leaves Madrid for Germany after making 17 senior appearances for Real last term. Borussia Dortmund's official Twitter account confirmed the deal on Wednesday, and Goal's Harry Sherlock provided further details about the switch.

The 19-year-old played in all three of Morocco's group games at the 2018 FIFA World Cup and moves to the Bundesliga hoping for a better opportunity at first-team football, with Lukasz Piszczek and Jeremy Toljan his competition.

Under Dortmund's guidance, the Spanish side will hope he'll return to the Santiago Bernabeu with the ability to impact their first-team plans more prominently.

Goal's Ronan Murphy hailed the signing as an astute one for the Black and Yellows, who will be managed by Lucien Favre heading into the new season after parting ways with Peter Stoger:

Ronan Murphy @swearimnotpaul

OFFICIAL: Borussia Dortmund have signed Real Madrid and Morocco defender Achraf Hakimi on a two-year loan deal.
Great signing for #BVB, one of the world’s best young full-backs. Hasn’t had much chances at Real, so good move for him too. No mention of a buy-out clause. https://t.co/Wpaviz4CBs

Dani Carvajal governs the right-back slot at Real, but now-departed manager Zinedine Zidane often showed a preference to use centre-back Nacho in the position, ahead of Hakimi, when the former was out of commission.

With long-term servant Piszczek now 33 and Toljan still growing into Dortmund's plans, Hakimi can hope to have a bigger role in Germany over the next two campaigns.