The 28-year-old striker's future at United has been mired in uncertainty since Chelsea tried to sign him last year, and he had only 18 months remaining on his current Old Trafford deal.
But Rooney now looks set to end his playing career at the club he has been at since 2004 after signing a new contract, reportedly worth up to 300,000 pounds ($501,000) a week.
The deal makes Rooney the league's top earner, and softens the blow of potentially not playing against Europe's elite clubs next season. In the first season since David Moyes replaced Alex Ferguson, United is seventh in the league with 12 matches remaining, 11 points from the fourth Champions League qualification place.
"It's not a massive concern for me," Rooney said on his personal website. "This is because I know the direction that this club is going in, and if we don't make it this season then we will come back stronger and claim a Champions League spot next season.
"Let's not forget we still have a chance this year. Some of the other teams are playing well, but we have a strong squad here and if we have a positive end to the season then who knows what can happen."
The England international has been at United almost a decade, since leaving an Everton side then managed by Moyes. In 403 United appearances, he has scored 208 goals, putting him fourth on the club's all-time scoring leaderboard, 41 behind Bobby Charlton.
"Wayne has been the best player in England since I put him into the Everton first team in 2003," Moyes said. "Since becoming United manager in July last year, I have enjoyed working with him and seeing just how he has developed his incredible talent.
"With his ability, his experience and his desire to succeed, he is a vital part of my plans for the future and I'm absolutely thrilled he has accepted the challenge."
As part of the new contract, Rooney will become a club ambassador when his playing career ends. And already, he is central to the club's global marketing operation, as one of the team's most high-profile players.
"I've been here since I was 18 and this contract will take me through to my 30s, which is almost my entire professional career," Rooney said. "I've played most of my best football here and am looking forward to hopefully playing even better football in the next few years."
Moyes is delighted to have prevented Rooney from joining a rival.
"Everyone would want him in their team," Moyes said. "There were clubs who did want him. There were clubs who would have wanted him (had he not signed a new deal) but there was never going to be a chance he was going to leave Manchester United, certainly not on my watch."
Convincing Rooney to stay, having already broken the club's transfer record to sign midfielder Juan Mata last month, should help Moyes persuade other players to join as he looks to strengthen the squad.
"Part of the rebuilding (process) is making sure that you keep the players you really want to keep," Moyes said.
"We are looking to bring the best players in the world to the club. I think Wayne Rooney is one of them. I will be looking to make more signings in the summer and hopefully add to the quality we already have got."