With its planned initial public offering just weeks away, social networking juggernaut Facebook reported that its first-quarter profit fell 12% thanks to a dramatic increase in the company’s expenses as it continues its torrid growth. In an amended IPO filing with the SEC, Facebook also disclosed that it has passed 900 million users, and provided details on its blockbuster $1 billion purchase of photo-sharing start-up Instagram. The new details came as Facebook announced plans to spend $550 million to bolster its patent portfolio amid a growing intellectual property dispute with Yahoo.

For the first three months of 2012, Facebook reported total revenue of $1.06 billion, an increase of 45% from one year ago. The company said net profit was $205 million, a 12% decrease from $233 million one year ago, as expenses rose from $343 million last year to $677 million this year.

Facebook now has 901 million monthly users, 500 million mobile users, and 125 billion friendship connections.

The social network’s users post a staggering 3.2 billion comments and “likes” every day; 300 million photos are uploaded per day.

Facebook plans to go public on the tech-heavy NASDAQ exchange using the symbol “FB.”

The company is sitting on $3.9 billion in cash; full-time employees grew from 2,431 as of March 31, 2011, to 3,539 as of March 31, 2012.

Facebook’s spending on research and development increased by 168% from $57 million to $153 million.

Facebook says access to its service “has been or is currently restricted in whole or in part in China, Iran, North Korea, and Syria.”

In the filing, Facebook disclosed that its deal to buy Instagram consists of $300 million in cash and “approximately 23 million shares” of common stock. If regulators block the deal, or it fails to close by the end of the year, Facebook has to pay Instagram $200 million. A source told Dan Primack at Fortune that Facebook used $30.89 as the share price in the Instagram deal, meaning that Facebook values itself at $77 billion.

Meanwhile, as the tech patent wars continue to escalate, Facebook moved on Monday to bolster its intellectual property stockpile by spending $550 million to buy 650 patents that Microsoft recently acquired from AOL in a billion-dollar deal. The move deepens Facebook’s existing strategic ties with Microsoft, at a time when the booming social network is embroiled in a patent showdown with Yahoo, which also happens to have an important web search partnership with Microsoft.

The deal highlights to occasionally awkward nature of tech industry relationships at a time of growing intellectual property conflict between some of the biggest names in the industry — both on the software and hardware side. In recent years, patents have become tools for corporate warfare, used to extract licensing fees from rivals and assert ownership over key aspects of widely-used technologies like mobile computing, web advertising and social networking.

Two weeks ago, in a savvy move, AOL sold over 800 of its patents to Microsoft, raising over $1 billion and sending its stock price soaring. AOL’s play was well-received in tech circles as a striking contrast to Yahoo, which has decided to sue Facebook for allegedly violating the purple Web-pioneer’s intellectual property. Facebook has counter-sued, leading to a war of words between the two companies.

On Monday, Facebook said it would spend $550 million in cash to acquire “approximately 650 AOL patents and patent applications, plus a license to the AOL patents and applications that Microsoft will purchase and own.” Facebook has now built an intellectual armory consisting of over 1,400 patents, covering everything from email, to instant messaging, web browsing, search, advertising, mobile, and e-commerce, according to a count by TechCrunch.

“Today’s agreement with Microsoft represents an important acquisition for Facebook,” Facebook’s general counsel Ted Ullyot said in a statement. “This is another significant step in our ongoing process of building an intellectual property portfolio to protect Facebook’s interests over the long term.”

The deal is another example of Microsoft and Facebook’s closeness. In 2007, Microsoft spent $240 million to acquire a 1.6% stake in Facebook at a then-whopping $15 billion valuation. Facebook is preparing to raise at least $5 billion in an IPO next month that could value the company at as much as $100 billion. Clearly, Microsoft views Facebook as an important ally to have, especially in opposition to Google, a major rival to both firms.

For its part, Yahoo tried to put the best face on the deal, issuing a statement saying it actually added credence to its position. “Nothing about today’s action changes the fact that Facebook continues to infringe our patents,” the company said. “Companies who purchase patents are often working from a position of weakness and take these actions to strengthen their portfolio. We see today’s announcement as a validation of our case against Facebook.”