Google's decision to sell Motorola Mobility to Lenovo for $2.91 billion was a huge loss for the company as the web giant bought it for $12.5 billion. But apparently Google actually made billions out of the deal.

Google officially confirmed Lenovo's acquisition of Motorola Mobility unit on Wednesday. Following the big announcement, several media reports stressed on the final amount Google settled for- $2.91 billion, which was significantly lower than the purchase price in 2012. The difference of almost $10 billion was seen as a huge loss for Google, but the real deal paints a different picture based on Forbes' estimates.

Google's main interest with the acquisition of Motorola Mobility was to add 17,000 mobile-related patents to its portfolio, so it could be used against rivals Apple and Microsoft in courtrooms. The patents did not help Google much to win any court battles, but the web giant had originally estimated the patents to be worth $5.5 billion.

If Google sold its smartphone-making company at a much lesser price than what it bought for, then how does it make billions in profit?  We must look back at what Google did with Motorola right from the beginning. To begin with, Google took over a cash pile of $3.2 billion and $2.4 billion in deferred tax assets when it initially paid $12.5 billion for Motorola acquisition in 2011, bringing the net acquisition cost to $6.9 billion.

 Google then sold the phone-maker's set-top box division to Arris Group, last year, in a deal valued at $2.35 billion. The web giant also sold its Motorola manufacturing operations in China to Flextronics for about $75 million, which recovered another $3.1 billion in Motorola investment that reduced the total acquisition cost to $3.85.

But there were some road bumps too with Motorola running into administrative losses close to $2 billion under Google's watch. However, if Google had originally estimated the Motorola patents to be worth $5.5 billion and it gave only 2,000 patents to Lenovo as a part of Motorola acquisition ($2.91 billion), then Google is still left with nearly $3 billion in profit.

In a nutshell, Google's acquisition of Motorola mobile unit was a smart investment and with a profitable outcome.

The deal is not so bad for Lenovo as well. The Chinese PC maker agreed to pay $660 million in cash, $750 million in stock and the rest over a three-year promissory note.