The 25-year-old will cost the English giants a reported fee of about £52 million ($69 million) and give Mourinho a powerful-looking midfield, with the Brazilian set to slot in alongside Paul Pogba and Nemanja Matic.
A statement on the club's website 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."
United finished second in the Premier League behind City but were a whopping 19 points behind their fierce rivals.
And beating City to the signature of Fred, who was a target for the English champions in January, could prove to be a significant first step.
Fred caught the eye in Shakhtar's run to the last-16 of the Champions League, where the Ukrainians only lost out on away goals to Roma.
A stunning free-kick in the first leg of that tie was a glimpse of what Fred's talented left foot can produce.
However, he is far more of a creator than goalscorer as his record of just 15 goals in five years at Shakhtar suggests.
United are in need of midfield reinforcements with Michael Carrick retiring and Marouane Fellaini out of contract.
Mourinho's task will now be to harness Fred's passing ability, while also finally getting the best out of Pogba in his third season since an £89 million move from Juventus.
Fred will hope to make the same impact on the Premier League as Brazilian international team-mates Willian and Fernandinho, who also arrived in England via spells with Shakhtar.
United fans are unlikely to get much of a glimpse of Fred at the World Cup in Russia, though, as he is yet to start an international under current coach Tite.
Handed his deubt by Dunga in 2014, Fred's international career was disrupted after testing positive for the diuretic hydrochlorothiazide during the 2015 Copa America.
He was banned from international football for a year by South America's governing body CONEMBOL, but only missed four months for Shakhtar as FIFA did not extend the ban to cover all confederations until February 2016.
Fred did not return to the national team until a 3-0 friendly win over Russia in March and Tite was keen for his transfer to be completed before the World Cup starts on June 14.
"Players are always thinking of their careers. What you say is please resolve it as soon as possible so we can get them focused back on the task in hand with the national team," he said after Saturday's 2-0 win over Croatia at Anfield.
"If I was a club manager, I would be looking to sign him."