This represents a 300% salary increase for the 27-year-old England captain.
"The club has bent over backwards to be fair in their dealings with me and I always knew that Manchester United were the only club I ever wanted to play
for," said Beckham.
"I was never really worried about the contract but I did want it all sorted out before the World Cup.
"Sir Alex Ferguson had made it very clear that he wanted me to be an important part of the club's future and his word was good enough for me.
"The bond between myself and the club and the fans is stronger than ever before.
"All the players at Manchester United feel that special bond and there is not a day passes when I do not feel very lucky and privileged to be part of such
a fantastic club."
Man United boss Sir Alex Ferguson said he was delighted to have secured the services of the midfielder.
"He is a terrific player who has played a big part in the team's successes
and with his new deal signed we can now settle down to enjoying the next few years with David as an important part of the team," he said.
Although it is not the highest salary in world football, Beckham receives so much from endorsements that he is set to overtake French star
Zinedine Zidane as football's top earner.
The new contract should take Beckham's total earnings to around �11m a year.
United chief executive Peter Kenyon admitted it was the issue surrounding image rights which had complicated discussions.
"The process of every player contract negotiation is different and one of the
unique aspects of David's was understanding how his global image could best be utilised to the mutual benefit of Manchester United and David himself."
He added: "It is important to point out that we never once doubted that David wanted to stay at United."