The former United striker will take charge of the first team with immediate effect and will select the squads while the club seeks a new full-time manager.
Solskjaer, 45, will be joined by Mike Phelan as first team coach who will work alongside Michael Carrick and Kieran McKenna.
"Manchester United is in my heart and it's brilliant to be coming back in this role," said Solskjaer. "I'm really looking forward to working with the very talented squad we have, the staff and everyone at the club."
Solskjaer joined United in 1996 from the Norwegian club Molde. During 11 years with the Old Trafford outfit, he made 235 appearances and scored 91 goals. The most famous of his strikes came in the closing seconds of second-half stoppage time in the 1999 Champions League final against Bayern Munich.
He prodded home Teddy Sheringham's header into the six yard box to give United a 2-1 victory and their second European Cup.
Ed Woodward, United's executive vice-chairman, said: "Ole is a club legend with huge experience, both on the pitch and in coaching roles.
"His history at Manchester United means he lives and breathes the culture here and everyone at the club is delighted to have him and Mike Phelan back.
"We are confident they will unite the players and the fans as we head into the second half of the season."
Solskjaer's first game in charge of the side will be at Cardiff City, one of his former managerial posts. Cardiff are in 16th place in the Premier League after 17 games. United are sixth with 26 points from their 17 outings.
Mourinho, 55, was dismissed on Tuesday following the club's worst start to a top flight season in 28 years. Friction with United's star signings as well as criticism of the club's transfer policies also contributed to his departure.
The Portuguese joined United in the summer of 2016 and during his tenure they won the Community Shield, the League Cup and the 2017 Europa League.