Microsoft will pay $5 billion for the Nokia unit that makes mobile phones, including its line of Lumia smartphones that run Windows Phone software.
Microsoft is also paying $2.2 billion for a 10-year license to use Nokia's patents, with the option to extend it indefinitely.
"We are very excited about the proposal to bring the best mobile device efforts of Microsoft and Nokia together," Microsoft CEO Steve Ballmer said in a memo to employees. "We are receiving incredible talent, technology and IP (intellectual property)."
Microsoft said it is acquiring Nokia's Asha brand of low to mid-level smartphones and will license the Nokia brand for current Nokia mobile products.
"This element provides Microsoft with the opportunity to extend its service offerings to a far wider group around the world while allowing Nokia's mobile phones to serve as an on-ramp to Windows Phone," the companies said in a joint statement.
Redmond, Wash.-based Microsoft said it will draw from its overseas cash resources to fund the transaction. When the deal closes in early 2014, about 32,000 Nokia employees will transfer to Microsoft, the companies said.
Nokia, based in Espoo, Finland, said Stephen Elop will 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.
Nokia plans to hold a news conference in Finland on Tuesday morning to discuss the deal.