The Norwegian has inspired a revival of United’s fortunes since taking over from the sacked Jose Mourinho in December, winning 14 of his 19 games and leading the Red Devils to the quarter-finals of the Champions League.
Solskjaer, who scored 126 goals in 366 appearances for United, was already a hero to fans as the man who scored the stoppage-time winner in the 1999 Champions League final to complete the treble.
“From the first day I arrived, I felt at home at this special club,” Solskjaer said in a statement on the club’s website. “It was an honour to be a Manchester United player, and then to start my coaching career here.
“The last few months have been a fantastic experience and I want to thank all of the coaches, players and staff for the work we’ve done so far.
“This is the job that I always dreamed of doing and I’m beyond excited to have the chance to lead the club long-term and hopefully deliver the continued success that our amazing fans deserve.”
United’s executive vice-chairman Ed Woodward said: “More than just performances and results, Ole brings a wealth of experience, both as a player and as a coach, coupled with a desire to give young players their chance and a deep understanding of the culture of the club.”