United announced on Friday the appointment of Sporting CP coach Ruben Amorim as his replacement.
Ten Hag's statement read: "Dear fans, Let me start by thanking you. Thank you for always being there for the club. Whether it was at a game far away or a tough match at Old Trafford, your support has been unshakeable.
"The atmosphere at Old Trafford has always been electrifying, thanks to you. I felt it many times. Also in away games, it gave the team and me an incredible feeling to hear the United chants taking over the opponents stadiums, whether the game was in England. Europe or during the summer tours.
"I always enjoyed meeting Manchester United fans throughout the world. Walking the streets and being able to chat with fans in England, Europe, Asia, Australia, the USA - you inspired me and radiated a strong sense of unity. That's what makes United supporters so special.
"I want to thank you for giving me this feeling and for your support. I also want to thank the staff in every department of the club for their unwavering support in good times and bad.
"We won two trophies - achievements that I will cherish for the rest of my life. Of course, my dream was to bring more trophies to the cabinet. Unfortunately, that dream has come to an end.
"I wish all Manchester United fans nothing but success, trophies and glory. Your support and the warmth I received from everyone at the club helped me feel at home.
"Thank you for this chapter in my life."