In addition to the purchase of the devices and services unit - an attempt by Microsoft to expand its share of the smartphone market - is a 10-year licence to use Nokia's patents at a cost of 1.7bn euros (£1.4bn).
Microsoft also secured an option of extending the agreement indefinitely.
The deal was reflected strongly when the Helsinki Stock Exchange opened for business as investors bought in to a marriage which analysts believed should have happened sooner.
Nokia (Xetra: 870737 - news) - once the darling of the mobile phone sector - tied with Microsoft two years ago when it ditched the Symbian operating system in favour of Windows software for its top smartphones.
Nevertheless, the latest market share research showed Nokia was the second largest seller of all mobile phones in the second quarter of the year - behind Samsung - with 14% after selling 60.9 million devices in the three months to June.
While Microsoft overtook BlackBerry for the first time in the smartphone operating system market, taking the third spot, it had just 3.3% of the business.
The deal was seen as aiding Microsoft's transition from a software firm to one that was much more serious about cracking the mobile market.
It was confirmed that 32,000 Nokia employees would transfer to Microsoft on completion of the sale - expected early next year.
Microsoft CEO Steve Ballmer - who confirmed last month that he was soon to retire - said of the deal: "We are very excited about the proposal to bring the best mobile device efforts of Microsoft and Nokia together.
"We are receiving incredible talent, technology and IP (intellectual property)."
Nokia confirmed Stephen Elop would step aside as president and CEO to become executive vice president of Nokia devices and services.
Chairman Risto Siilasmaa will stay in his current role and assume the duties of interim CEO.
Elop is expected to join Microsoft at the close of the transaction, along with several Nokia vice presidents.
The announcement marked the second mega deal for the telecoms sector in a day after UK-based Vodafone (LSE: VOD.L - news) confirmed the sale of its 45% stake in US group Verizon Wireless for $130bn (£84bn) - netting its investors a £54bn cash and shares windfall.
More From Sky News