The Portugal international had been linked with an exit from Old Trafford following a disappointing 2012-13 campaign in which he made just seven league starts under then-manager Alex Ferguson.
But new boss David Moyes has signalled his faith in the 26-year-old by handing him a new long-term deal.
"I'm really pleased Nani has re-signed for the next five years," the Scot said.
"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 has made over 200 appearances for United since his arrival in 2007, winning four Premier League titles and the UEFA Champions League during that time.
"Playing at United has been a fantastic experience for me," the winger enthused after penning his extension.
"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."
Nani has often been compared with compatriot Cristiano Ronaldo, who also started his career at Sporting Lisbon before moving to Manchester United.
However, the pacy winger struggled with poor form and injuries last season, and provided just four goals as a result.
He has made just one substitute appearance in three Premier League games for the champions this term, but appears set to play a prominent role under Moyes.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.