A little more than a decade ago, Microsoft (MSFT) helped out a promising social media outfit called Facebook (FB) with $240 million in capital.

Microsoft may reap billions in the coming years as it harvests gains from the investment, MoffettNathanson LLC analyst Adam Holt suggested in a recent report.

Microsoft CFO Amy Hood noted during the company's recent earnings call that the tech giant is taking "gains in our equities portfolio." Sales of equities drove Microsoft's "other income" line to to $450 million in the recent quarter, up from an already-higher-than-expected $215 million in the prior three-month period. Reading between the lines, Holt suggested that Microsoft is likely tapping its long-held Facebook stock.

Back in October 2007, Microsoft, then led by Steve Ballmer, beat out Alphabet's (GOOGL)  Google unit and other investors who wanted to fund the pre-IPO Facebook. The enterprise software powerhouse took a 1.6% stake in Facebook and provided funds to expand its advertising capabilities.

During a call with analysts and the press to announce the deal, Microsoft co-president of platforms and services Kevin Johnson actually had to defend the $15 billion valuation that the fundraising ascribed to Facebook.

Facebook had 50 million active users at the time and Johnson suggested that the company could reach 200 million to 300 million users.  "You combine that number of users with the monetization opportunities and you can figure out a fairly modest average revenue per-user per-year," Johnson said. "You can very quickly get to these levels of valuation." 

As of the last quarter, Facebook has 1.37 billion daily active users and 2.07 billion monthly users. After a 55% jump in the value of its stock this year, Facebook's market cap is about $520 billion. Microsoft is still larger, however, with a nearly $650 billion market valuation.

Microsoft scored a win with the Facebook stake, but not as big as the victory that the former Yahoo! Inc. notched with its 2005 investment in Alibaba (BABA) . At the time, Yahoo! bought 46% of Alibaba in for $1 billion in cash, a Chinese subsidiary and other compensation. Today, the 15% Alibaba stake that successor company Altaba (AABA)  retains is worth about $69 billion, and the company also reaped billions through its sale of other parts of its stake in recent years.

Microsoft's Facebook stake is worth a respectable $8 billion to $9 billion, Holt suggests, and could take six to eight years to fully exit. The proceeds could add 6 cents to fiscal year 2019 earnings per share and 5 cents to 2020 EPS.

Facebook and Alphabet are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells FB or GOOGL? Learn more now.

More of What's Trending on TheStreet:

Editors' pick: Originally published Nov. 15.

More from Stocks

IBM, Microsoft, Papa John's and UnitedHealth - 5 Things You Must Know

IBM, Microsoft, Papa John's and UnitedHealth - 5 Things You Must Know

The Secret Messages Hidden Underneath IBM's Surprising Profit Blowout

The Secret Messages Hidden Underneath IBM's Surprising Profit Blowout

The Recent Pullback in the Defense Sector Provides a Buying Opportunity

The Recent Pullback in the Defense Sector Provides a Buying Opportunity

Futures Lower on Trade Worries and 4 Other Stories to Watch Thursday

Futures Lower on Trade Worries and 4 Other Stories to Watch Thursday

Video: What to Expect From Microsoft's Earnings Thursday

Video: What to Expect From Microsoft's Earnings Thursday