Microsoft has bought Nokia's mobile phones business for £4.6 billion.
The titanic deal will reshape the entire mobile technology landscape.
Despite slowly increasing sales of devices running its Windows Phone, Microsoft has struggled in the mobile devices market in recent years. It recently lost close to $1 billion on its Surface RT tablets, which were received poorly.
Meanwhile Nokia's once dominant position in mobile phones has been brought virtually to its knees after years of failing to respond to the advance of Apple's iPhone and Google's Android OS. Two years ago it made a decision to focus exclusively on Windows Phone with its Lumia line of smartphone devices - and again, despite gradually increasing sales it is yet to make a real dent in the market share of either Apple or Samsung.
The companies said in a joint statement that the deal will be finalised in 2014, and that in total about 32,000 of Nokia's employees will now work for Microsoft.
Nokia will also license its patents and its maps service 'Here' to Microsoft as part of the deal.
"Bringing these great teams together will accelerate Microsoft's share and profits in phones, and strengthen the overall opportunities for both Microsoft and our partners across our entire family of devices and services."
Nokia and Microsoft first teamed up in February 2011 on the former's Lumia smartphones.
Stephen Elop, Nokia president and chief executive, will step down to become head of the Nokia devices and services business within Microsoft, returning to his former company.
He has been tipped as one of the front-runners to take over from Mr Ballmer, who plans to retire within a year.
Elop said the deal provides the "opportunity to accelerate the current momentum and cutting-edge innovation of both our smart devices and mobile phone products".
It is understood that Microsoft and Nokia have been in negotiations since the end of January.
The full statement announcing the news reads:
"Nokia and Microsoft have always dreamed big – we dreamed of putting a computer on every desk, and a mobile phone in every pocket, and we’ve come a long way toward realizing those dreams.
Today marks a moment of reinvention.
Nokia has an identity spanning 150 years of heritage, innovation, excellence, and change which began and will continue in Finland and around the world. From humble beginnings as a paper mill factory, to manufacturing rubber boots and car tires, and then to mobile phones, reinvention is in Nokia’s blood.
Nokia will now write its next chapter, focused on enabling mobility through its leadership in networking, mapping & location, and advanced technologies.
For Microsoft as well, today is a bold step into the future, a huge leap forward on our journey of creating a family of devices and services that delight people and empower businesses of all sizes.
Our partnership over the past two and a half years, which combined our respective strengths to build a new global mobile ecosystem, has created incredible results: award-winning phones and amazing services that have made Nokia Windows Phones the fastest-growing smartphones in the world.
Building on this successful partnership, we announced some important news today: an agreement for Microsoft to purchase Nokia’s Devices & Services business, to deliver more choices, faster innovation, and even more exciting devices and services to our customers.
Today’s agreement will accelerate the momentum of Nokia’s devices and services, bringing the world’s most innovative smartphones to more people, while continuing to connect the next billion people with Nokia’s mobile phone portfolio.
With the commitment and resources of Microsoft to take Nokia’s devices and services forward, we can now realize the full potential of the Windows ecosystem, providing the most compelling experiences for people at home, at work and everywhere in between.
We will continue to build the mobile phones you’ve come to love, while investing in the future – new phones and services that combine the best of Microsoft and the best of Nokia.
Nokia and Microsoft are committed to the next chapter.
Together, we will redefine the boundaries of mobility."