The 26-year-old's future looked in doubt over the summer but, with one year remaining on his current deal, the winger secures his stay at Old Trafford, signing until 2018.Manchester United has announced that Portuguese winger Nani has signed a new five-year contract with the club.
The wide-man has been at United since 2007 after signing from Sporting Lisbon and had one year remaining on his deal.
Moyes told the club's official website: "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 only featured in 10 Premier League games for Sir Alex Ferguson last campaign and his future had been under the spotlight as the likes of Paris Saint-Germain, Monaco and Zenit St Petersburg looked to lure him away from the Premier League club.
However, the new contract will keep the Portugal international at Old Trafford until 2018 and Nani paid tribute to Moyes.
"Playing at United has been a fantastic experience for me. When I came to the club, I never imagined the success we have enjoyed," he said.
"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 honors this season."