The Dutchman will take over from the end of this season until June 2025, with an option to extend for another year.
“It is a great honor to be appointed manager of Manchester United and I am really looking forward to the challenge ahead,” Ten Hag said in a statement.
“Knowing the history of this great club and the passion of the fans, I am fully committed to building a team capable of achieving the success it deserves.
“It will be difficult to leave Ajax after these incredible years and I can assure our fans of my full commitment and focus on bringing this season to a successful conclusion before I join Manchester United.”
“Over the past four years at Ajax, Erik has proven to be one of Europe’s most exciting and successful coaches, known for attractive, attacking football and his side’s commitment to youth,” said United director of football John Murtough.
“In our discussions with Erik leading up to this appointment, we were deeply impressed by his long-term vision to bring Manchester United back to the level at which we aim to compete and by his drive and determination to achieve that.
“We wish Erik the best of luck as he focuses on completing the season at Ajax and look forward to welcoming him to Manchester United this summer.”
The 52-year-old joins United from Dutch club Ajax, where he has guided the club to two Eredivisie titles since becoming head coach in 2018.
Ten Hag is the fifth permanent manager appointed by United since Alex Ferguson retired in 2013, after David Moyes, Luis van Gaal, Jose Mourinho and Ole Gunnar Solskjær.
The Dutchman takes over the office of the previous interim manager Ralf Rangnick. Rangnick will remain with the association in an advisory capacity.
United are currently battling for a place in the top four in the league table in a bid to qualify for next season’s Champions League.