The Portuguese winger signed for United in May 2007 and has won four Barclays Premier League titles, two League Cups, a FIFA Club World Cup and the UEFA Champions League in his six seasons at Old Trafford.
David Moyes said: "I'm really pleased Nani has re-signed for the next five years. He has great ability and experience beyond his 26 years. I've been impressed with his approach to training and look forward to working with him in the coming seasons."
Nani said: "Playing at United has been a fantastic experience for me. When I came to the Club, I never imagined the success we have enjoyed. Training every day with top players who want to win trophies every year is a great motivation to me. I'm very happy that the new manager has shown this faith in me and I'm looking forward to helping the team compete for more honours this season."