The Brazil international's contract was due to expire next summer.
The 30 year old leaves Old Trafford having made 213 appearances for the club since joining from Shakhtar Donetsk in 2018.
"Thanks for everything, Manchester United Football Club," said Fred in a social media post.
“Today ends one of the most beautiful stages of my career. I lived the dream of wearing the shirt of one of the biggest clubs in the world.
“Going through ups and downs, I leave with the conviction that I always gave my best during all training sessions and games.
“It was five years of a true dream for me and my family. I will be forever grateful for the opportunity. Forever a Red!”
More from Sporting Life
Safer gambling
We are committed in our support of safer gambling. Recommended bets are advised to over-18s and we strongly encourage readers to wager only what they can afford to lose.
If you are concerned about your gambling, please call the National Gambling Helpline / GamCare on 0808 8020 133.
Further support and information can be found at begambleaware.org and gamblingtherapy.org.