Although Facebook didn’t buy AOL’s patent portfolio the other week — it was gobbled up by Microsoft for $1 billion — it’s going to get a big serving of those patents anyway: Microsoft and Facebook today announced that Microsoft would be selling to Facebook 650 of the 925 patents that it bought from AOL to Facebook for $550 million in cash.

It will also get a license for the remaining 275 patents that Microsoft bought from the AOL portfolio, which Microsoft will continue to own. On top of this, Microsoft also has a license for the 300 patents that AOL still owns; but at this point, Facebook will not have a license for those patents still owned by AOL.

The deal gives Facebook a much stronger position in the world of patents, where it had been weak up to now and has been facing lawsuits, most notably from Yahoo, over infringement. It now appears to own 1,460 patents (750 from IBM, these 650 from Microsoft/AOL, 60 of its own) plus applications for more, plus any it may be getting through acquisitions.

Update: For more analysis, read “Rather Than Pay Off Yahoo, Facebook Built A Fortress 1400 Patents Strong”

This is also a big coup for Microsoft, since it helps it gain back some of the astounding $1 billion it spent on those patents in the first place:

“Today’s agreement with Facebook enables us to recoup over half of our costs while achieving our goals from the AOL auction,” said Brad Smith, executive vice president and general counsel, Microsoft. “As we said earlier this month, we had submitted the winning AOL bid in order to obtain a durable license to the full AOL portfolio and ownership of certain patents that complement our existing portfolio.”

It’s also not terribly surprising: when the AOL/Microsoft deal was first announced, we wondered if the followup would be some kind of deal with Facebook, given that Microsoft is a shareholder in the social network.

The news today comes on the heels of Facebook buying a patent trove from IBM and gives the company yet further artillery to defend itself against lawsuits from other companies claiming infringement on some of the social media mechanics that Facebook uses on its site.

Most notably, Yahoo has been suing the company (and Facebook is suing back).

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

More big Facebook news from today:

Rather Than Pay Off Yahoo, Facebook Built A Fortress 1400 Patents Strong

Facebook’s Amended S-1: 901 Million Users, 500M Mobile, Paid $300M Cash + 23M Shares For Instagram

Zynga Contributed 15% of Facebook’s Revenue In Q1, Down From 19% A Year Ago

You Earn Facebook An Average Of $1.21 Per Quarter