The software giant said the boards of both companies have unanimously backed the takeover, which will be complete by the end of the year subject to approval from regulators and LinkedIn shareholders.
The deal will see Microsoft paying 196 US dollars per share (£138) for the social media website in an all-cash transaction funded by issuing new debt.
Shares in LinkedIn soared 47% on the New York Stock Exchange in the wake of the announcement. Microsoft was down 3%.
The takeover is the largest acquisition in Microsoft’s history, overshadowing its deal for internet phone service Skype for 8.5 billion US dollars (£6 billion) in 2011 and its 7.2 billion US dollar (£5.1 billion) deal for Nokia’s devices business in 2014.
Microsoft chief executive Satya Nadella said the tie-up would “accelerate the growth of LinkedIn, as well as Microsoft Office 365 and Dynamics as we seek to empower every person and organisation on the planet”.
LinkedIn has seen its global membership grow by just under a fifth year-on-year to 433 million, while the number of active job listings on the site has climbed 101% year-on-year to more than seven million.
The social media firm - which has launched a new version of its smartphone app in the past year - now sees 60% of its users coming through mobile devices.
The deal comes after LinkedIn saw close to 11 billion US dollars (£7.8 billion) wiped off its market value in February when shares plunged more than 43% after its revenue forecasts came in below analyst expectations.
Investors on Wall Street took flight after it forecast full-year revenues to hit between 3.6 and 3.65 billion US dollars (£2.5 billion and £2.6 billion), falling short of analyst predictions of around 3.91 billion US dollars (£2.8 billion).
Microsoft said the deal will see LinkedIn chief executive Jeff Weiner holding onto his post and reporting into Mr Nadella.
Mr Weiner added: “Just as we have changed the way the world connects to opportunity, this relationship with Microsoft, and the combination of their cloud and LinkedIn’s network, now gives us a chance to also change the way the world works.
“For the last 13 years, we’ve been uniquely positioned to connect professionals to make them more productive and successful, and I’m looking forward to leading our team through the next chapter of our story.”
LinkedIn, which is based in Mountain View, California, floated on the stock market in May 2011.
Richard Windsor, analyst at Edison Investment Research said the value of the deal will depend on whether Microsoft can successfully marry the LinkedIn website with its existing software.
He added: “The deal is expensive, but LinkedIn is unopposed in its space and has virtually 100% market share in what it does.
“This means that it is not difficult to see a lot of value in the acquisition should Microsoft execute it properly. It also fits very well within where we see Microsoft going which is increasingly towards the enterprise and away from the consumer.
“To really make the most of this acquisition LinkedIn needs to be seamlessly integrated with Microsoft’s other assets particularly Office and this is something that historically Microsoft has been very bad at.”