Microsoft is to acquire Nokia's Devices & Services business, which includes the smartphone and mobile phones businesses, and license the Finnish company's patents for a total of €5.44 billion (£4.60 billion) in cash.

Microsoft will pay €3.79 billion for "substantially all" of the Devices & Services business and €1.65 billion to license Nokia's patents at the close of the transaction.

Nokia CEO Stephen Elop will be coming back to Microsoft and lead an expanded devices team, Microsoft CEO Steve Ballmer said. Microsoft said it will draw on its overseas cash resources to fund the transaction.

"Building on the partnership with Nokia announced in February 2011 and the increasing success of Nokia's Lumia smartphones, Microsoft aims to accelerate the growth of its share and profit in mobile devices through faster innovation, increased synergies, and unified branding and marketing," it said in a statement.

Nokia has been building smartphones around Microsoft's Windows Phone operating system in a bid to boost flagging market share, besides focusing on feature phones for emerging markets.

Following the transaction, Nokia plans to focus on its network infrastructure and services business called NSN, its HERE mapping and location services, and Advanced Technologies, focused on technology development and licensing. It will continue to own and maintain the Nokia brand but will license it to Microsoft for a 10-year period to use the brand on current mobile phones and some subsequently developed phones.

Risto Siilasmaa will take over as interim CEO for Nokia while continuing to serve as chairman of Nokia's board. He will have four direct reports: Michael Halbherr, executive vice president of HERE; Elop as executive vice president of Devices & Services; Timo Ihamuotila, Nokia CFO and interim president; and Jesper Ovesen, executive chairman of the NSN board of directors, Nokia said.

The Finnish company will continue to have its headquarters in Finland. About 32,000 people are expected to transfer to Microsoft at closing, including approximately 4,700 people in Finland. Nokia employed about 56,000 people in addition at the end of the second quarter of 2013.

Microsoft will also acquire Nokia's design team, manufacturing and assembly facilities around the world, and operations, sales, marketing and support teams, Ballmer wrote in his email to employees. Ballmer announced recently that he was retiring at some point in the next 12 months from the post of CEO of Microsoft. Elop has been cited in reports as a possible contender for the post.

As part of the transaction, Nokia will give Microsoft a 10 year non-exclusive licence to its patents as of the time of the closing, and Microsoft will grant Nokia reciprocal rights related to HERE services. Microsoft will have the option to extend the mutual patent agreement to perpetuity.

Nokia reported a net loss in the second quarter, even as sales of its Lumia smartphones picked up to 7.4 million units. Net sales totalled €5.70 billion in the quarter, down 24% year-on-year. The company also reported a net loss of €278 million, which was smaller than the year-earlier loss of €1.53 billion. Nokia had a 15.8% share of the mobile phone market in the second quarter to Samsung Electronics' 27.7% and Apple's 8.1%, according to research firm Strategy Analytics.

"This is a smart acquisition for Microsoft, and a good deal for both companies. We are receiving incredible talent, technology and IP. We've all seen the amazing work that Nokia and Microsoft have done together," Ballmer said in the email to employees. Nokia decided to adopt Windows Phone as its principal smartphone strategy as part of a large deal with Microsoft in February 2011, which included collaboration on joint marketing initiatives and a shared development roadmap.

Success in phones is important to success in tablets, which in turn would help PCs, Microsoft said in presentation slides. Integration of hardware and software will help Microsoft offer competitive alternatives to Apple and Google.

Microsoft's getting into selling smartphones and feature phones may not go down well with some of its hardware partners that use Microsoft software, as they are used to dealing with Microsoft as a supplier of software, rather than as a competitor. Its own recent bid to counter Apple and Samsung in the tablet market has not been very successful, and the company said in a regulatory filing with the US Securities and Exchange Commission in July that its Surface tablet had earned revenue of $853 million in its fiscal year ended June 30. The company earlier took a charge for Surface RT inventory adjustments of approximately $900 million.

The transaction with Nokia is expected to close in the first quarter of 2014, subject to regulatory approvals and customary closing conditions. Microsoft will submit the proposed acquisition for approval in the EU, US, China, India, Brazil, Russia, Canada and other countries.