The 25-year-old midfielder joins for a fee understood to be in the region of £52m, with north of £40m guaranteed and the rest to be paid in add-ons.
Fred was in Liverpool to face Croatia with Brazil, a game they won 2-0 at Anfield on Sunday, before making the short trip over to Manchester to finalise the move and complete a medical.
How will Manchester United line up this season?
Show all 12
In a statement on their website, the club said: "Manchester United is delighted to announce it has reached agreement with Shakhtar Donetsk for the transfer of Frederico Rodrigues de Paula Santos (Fred). A further announcement will be made in due course."
The Brazilian, a box-to-box midfielder who was seen as a cheaper alternative to the in-demand Sergei Milinkovic-Savic of Lazio, is expected to double his wages in the Premier League while his early arrival will allow Mourinho and Ed Woodward to focus on defensive reinforcements, a priority for the Old Trafford club this summer.
United supporters will be able to see Fred in action during Brazil's final World Cup 2018 warm-up game against Austria on Sunday, before they kick off their campaign in Russia against Switzerland a week later.
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies