"I am thrilled that Rafael van der Vaart has rejoined," said HSV head coach Thorsten Fink. "He will be a great addition to our team."
Van der Vaart is something of a hero in Hamburg, having played for HSV between 2005 and 2008.
The transfer of the player from English side Tottenham Hotspur was reported to have been financed by a local investor who had also contributed to the previous transfers.
Hamburg managed to knock Spurs boss Daniel Levy down from his initial €18 million asking price.
Meanwhile, Barcelona midfielder Ibrahim Afellay completed a medical to join Schalke on a one-year loan from Dutch side PSV Eindhoven. The 26-year-old Dutch international was praised in advance for his versatility by coach Huub Stevens.
"He has special qualities and can play in many positions. In Eindhoven he played centrally, but he can also go on the left or right," said Stevens.
The 26-year-old Afellay, who has 41 caps for the Netherlands, will hope to secure regular playing time in Germany.
Schalke sent Spanish midfielder Jose Manuel Jurado to Spartak Moscow on loan to help finance the deal. The 26-year-old will remain with the Russian club for a year.
Earlier in the week, Bayern Munich signed Javi Martinez from Athletic Bilbao, widely seen as one of the major transfers of the summer after the signing of Marco Reus by Borussia Dortmund from Borussia Mönchengladbach.
He was one of several high-profile players to join Bayern after signings that included Dante from Borussia Mönchengladbach and Mario Mandzukic from Wolfsburg.
Meanwhile Bundesliga new boys Greuther Fürth signed Schalke's Brazilian striker Edu on loan until the end of the year.