The Dutchman will take over from the end of this season until June 2025, with the option to extend for a further year.
“It is a great honour to be appointed manager of Manchester United and I am hugely excited by the challenge ahead,” Ten Hag said in a statement.
“I know the history of this great club and the passion of the fans, and I am absolutely determined to develop a team capable of delivering the success they deserve.
“It will be difficult to leave Ajax after these incredible years, and I can assure our fans of my complete commitment and focus on bringing this season to a successful conclusion before I move to Manchester United.”
“During the past four years at Ajax, Erik has proved himself to be one of the most exciting and successful coaches in Europe, renowned for his team’s attractive, attacking football and commitment to youth,” said United football director John Murtough.
“In our conversations with Erik leading up to this appointment, we were deeply impressed with his long-term vision for returning Manchester United to the level we want to be competing at, and his drive and determination to achieve that.
“We wish Erik the best of luck as he focuses on achieving a successful end to the season at Ajax and look forward to welcoming him to Manchester United this summer.”
The 52-year-old joins United from Dutch side Ajax, where he led the club to two Eredivisie titles since becoming the head coach in 2018.
Ten Hag is the fifth permanent manager to be appointed by United since Alex Ferguson retired in 2013 following David Moyes, Luis van Gaal, Jose Mourinho and Ole Gunnar Solskjær.
The Dutchman will take over from current interim manager Ralf Rangnick. Rangnick will stay on with the club in an advisory role.
United are currently battling for a top-four finish in the league table to qualify for next season’s Champions League.