The 23-year-old had already agreed personal terms with Real and is now ready to complete the transfer for an undisclosed fee subject to a medical.

"Obviously you don't gladly let such a leading player and figure like Sami Khedira leave, but on the other hand, we could understand Sami's desire to continue his career with Real," explained Stuttgart's director of sport Fredi Bobic.

"We wish him lots of success with his new challenge in Madrid."

The Germany international has spent his entire career with the Swabians, coming through the youth ranks from the age of eight to make his first-team debut in October 2006, the season in which Stuttgart last won the Bundesliga.

He became a regular in Armin Veh's team that season and penned his first professional contract just after the winter break, a deal he extended in 2008 until 2011.

He captained the Germany under-21 side to glory at the European Championships in 2009 and made his senior international debut last September.

Less than a year later, he was an ever-present for Germany at the World Cup, scoring his first international goal in the third-place play-off against Uruguay earlier this month.

That goal and his performances in South Africa convinced Real coach Jose Mourinho to make him one of his top summer targets and Khedira will take the next step in his career in the Primera Division next season.