Moyes: I had to fight to keep Rooney at United
Moyes moved to the 13-time Premier League champions from Everton at the start of the 2013-14 season, but failed to live up to the high standards set by his predecessor Alex Ferguson.
After just 10 months in charge, Moyes departed Old Trafford and has since taken the reigns at La Liga outfit Real Sociedad.
Chelsea's interest in signing Rooney was well publicised, but Moyes has revealed his part in ensuring the England captain remained at United.
"Chelsea were close to taking him," Moyes told the Sunday Times.
"Jose [Mourinho] was interested but we wouldn't do any business. I had to fight to make sure he stayed - and was at the heart, again, of what Manchester United were going to be moving forward."
Moyes gave Rooney his senior debut while at Everton, but felt he needed to revitalise the striker once they were reunited at Old Trafford.
"I felt he'd lost a bit of his fight," Moyes said.
"The thing about Wayne was he was always a fighter; he's a technically terrific footballer, can do anything with the ball, but behind it he's a tough boy, a street fighter in his football, and I felt he'd lost a bit of that.
"I think he agreed and probably thought, 'Wait a minute, I have to go back to being a bit more aggressive, a bit more myself."