The deal will see Nokia’s current chief executive, Stephen Elop, join Microsoft and makes him favourite to replace Steve Ballmer, who announced his retirement last month. Labrokes said he was now 4/6 favourite to take the role, with Facebook’s Sheryl Sandberg 7/1 and former Microsoft executive Steve Sinofsky 12/1.

Nokia’s chairman, Risto Siilasmaa, admitted that the Finnish company’s effective exit from the mobile phone business it pioneered was an “emotional” decision but made financial and strategic sense.

He said it lacked the resources to properly promote its Lumia smartphones, which use Microsoft’s Windows Phone operating system, in a sector dominated by the Apple iPhone and handsets running Google’s Android software, particularly Samsung’s Galaxy range.

He said: “The industry is becoming a duopoly with the leaders building significant financial momentum. Nokia alone doesn’t have the resources to fund the required acceleration.”

The struggles of Nokia’s mobile phone business, which accounted for around half the group’s revenues last year, have weighed heavily on profits. In the first half of this year underlying margin was 4pc, it said, but would have been 12pc without having to battle in the fiercely competitive sector.

The company's shares were up more than 40pc following the announcement this morning.

However, shares in Microsoft dropped 4.5pc - or $11bn of its market value - as investors questioned the logic of the deal by underperforming company that lost more than $4bn in 2012.

"They can in all likelihood carve out a decent niche with their scale as a fully integrated player, however investors are questioning the merits," said Todd Lowenstein, a portfolio manager at HighMark Capital Management, which holds Microsoft shares.

Nokia’s chief financial officer Timo Ihamuotila said: “Rationally this transaction is the right step but emotionally this transaction is more complex.”

When the introduction of the iPhone sparked the mobile internet revolution in 2007, Nokia was the biggest mobile phone maker. It has since ceded that position to Samsung and its share of the crucial smartphone sector has dwindled from nearly 50pc to 3pc in the first half of this year, according to the industry analysts Gartner.

Nokia will retain its mobile network equipment business, NSN, its R&D and patent licensing division, and Here, its location and mapping unit.

Some 32,000 of the company’s 98,000 staff will be transferred to Microsoft, when the deal is completed in the first quarter of 2014.

Microsoft will pay €3.79bn to buy Nokia’s mobile phone design, manufacturing and sales operations, and €1.65bn to license Nokia’s patents for 10 years. It will also be able to use the Nokia brand on handsets for 10 years.

Microsoft will immediately provide a €1.5bn financing facility to Nokia regardless of whether the deal goes through, in an indication of the Finnish company’s poor health and the difficulty it would have had raising cheap cash on the bond markets in the midst of major corporate restructuring. If Nokia draws down the financing it will repay it when the deal goes through.

The deal is Microsoft’s most significant yet in its effort to break Apple and Google’s stranglehold on the smartphone business. It did not introduce Windows Phone until late 2010 and has struggled to haul back the lead established by its rivals despite well-regarded software and heavy marketing investment.

Ownership of a major device manufacturer will make its operation more comparable to those of Apple and Google, which both make their own mobile hardware.

Ben Wood, an industry analyst at CCS Insight, said: “With mobile now firmly positioned as the world’s fastest growing and largest computing platform we see this move as a bold, but entirely necessary gamble by Microsoft. Mobile needs to be a cornerstone of Microsoft's business for future success.

“The failure of Microsoft’s platform-only approach over the last 15 years, initially with Windows Mobile and more recently with Windows Phone, has left it with few alternatives given its almost complete reliance on Nokia for Windows Phone devices and the competitive ecosystem strength of Google and Apple.

Mr Elop, 49, who took the helm at Nokia three years ago, insisted the mobile phone business would thrive and be seen as a stronger challenger under Microsoft despite starting from "so far behind". The former Microsoft executive dumped Nokia's own smartphone software and threw its lot in with the American software giant, forging strategic links that culminated in today's acquisition.

He said: “We have been going faster than Nokia has ever gone before. Achieving our goal of becoming the third ecosystem is becoming very real.

Mr Ballmer was at pains to reassure Finns, for whom Nokia's international success has been a source of national pride, that Microsoft is “deeply committed to Finland”.