Hakimi has spent the last two seasons on loan at the Signal Iduna Park from Real Madrid but his future in the Spanish capital is far from guaranteed.
The 21-year-old Moroccan international has already arrived in Milan for a medical ahead of a proposed switch to Antonio Conte’s side.
Hakimi made 73 appearances in all competitions for Dortmund and scored 12 goals, winning the 2019 German Super Cup.
"The time has come to close a very beautiful stage in my life. After two wonderful years, I'm ready to leave this club that has given me so much joy," Hakimi wrote on Twitter and Instagram.
"From the first moment, the care and attention by the club and the city has been amazing. Now I know that I was right to choose Dortmund as my home two years ago.
"I want to thank all my teammates, the coaching staff, and all the club's staff for the love and trust they have shown me at all times.
"I also want to thank the wonderful fans who have supported us unconditionally in every game.
"I'll never forget the yellow wall (Glebe Wand) which is simply wonderful.
"Finally, I would like to thank my family and friends for supporting me at all times.
"I hope that one day our paths will cross again. See you soon Borussia Dortmund!"
Dortmund finished second in the just ended Bundesliga season.