SAN FRANCISCO — Google's deal to sell its Motorola Mobility unit to Lenovo for $2.9 billion delivered a double-barreled shocker to the tech industry as the sale promised to scramble the playing field for mobile devices.

The transaction marks an abrupt U-turn for Google, which bought the troubled smartphone maker less than two years ago for $12.5 billion. Beijing-based Lenovo, by moving deeper into mobile markets, demonstrated that it has ambitions far beyond becoming the world's largest PC maker.

"The smartphone market is super competitive, and to thrive it helps to be all-in when it comes to making mobile devices," Google Chief Executive Larry Page said in a blog post explaining the deal. "It's why we believe that Motorola will be better served by Lenovo."

Google's purchase of Motorola was seen as an audacious bet by Page, his first big move after returning to the chief executive's chair in 2011. Page believed he could use Motorola to improve the quality of handsets running Google's Android operating system while using its patent portfolio to defend partners from increasingly bitter litigation.

Still, it was also a major risk, taking the company far from its roots as a search engine and Web-based services.

Google allowed the phone maker to work independently over the last few years. But despite launching some innovative devices, Motorola could not find success under Google's ownership. In its most recent quarter, Motorola reported a loss of $248 million.

The loss that Google may take on the deal is not quite as steep as its first appears, and, in fact, some analysts estimate that it may have broken even.

Mark May, an analyst at Citigroup, said the price of the original deal included $2.9 billion in cash that Motorola had on hand. And he noted that Google is keeping the "vast majority" of Motorola's mobile patents, which it once valued at $5.5 billion. The company also sold Motorola's set-top box business for $2.35 billion back in 2012.

Throw in the $2.9 billion Google will get from Lenovo, and some assorted tax gains, and the numbers are not quite so bleak.

"When you take those into account, it appears that Google was essentially able to acquire the mobile patents held by Motorola and sell off the remainder of the business for roughly the same value that it purchased it for about two years ago," May said.

Still, Motorola suffered about $2 billion in losses that Google had to subsidize along the way. As such, the relief among Google investors that it unloaded Motorola was clear. In after-hours trading, Google's stock rose $28.08, or 2.54%, to $1,135.00.

Lenovo now faces the challenge of turning around the Motorola business. But it's unlikely competitors will underestimate a company that has managed to grow the number of PCs and laptops it sells even in an era in which that overall business has been in decline.

During a call with reporters Wednesday, Lenovo Chief Executive Yang Yuanqing said the company was acquiring a "legendary brand" that would accelerate the company's strategy to become a major player in the global smartphone market.

"Smartphone is a pillar of our future growth," he said. "Motorola can help Lenovo have a much broader portfolio."

Yuanqing said there were no plans to close Motorola facilities or lay off employees in the U.S. He said the company would use both the Motorola and Lenovo brand names for its mobile products, and that Motorola would be marketed in the U.S.

"Over time whether we will integrate the two product lines, or the two brands, together, we will reassess that," he said.

The purchase quickly drew comparisons with Lenovo's 2005 purchase of IBM's PC business for $1.75 billion. That deal lifted the then-little known Chinese company into the ranks of the biggest global manufacturers of personal computers.

The latest deal, said IBB Consulting's Andrew Costello, "has very much the same potential" for Lenovo, which will be bolstered by Motorola's brand, manufacturing technology and global sales channels.

Lenovo said it would pay $1.41 billion in cash and stock, once it has been approved by both the U.S. and China. It will pay the remaining $1.5 billion in the form of a three-year promissory note, the company said.

This is the Chinese company's second major U.S. acquisition this month. Earlier, Lenovo purchased IBM's x86 server unit for $2.3 billion.

Both deals are among the biggest Chinese overseas acquisitions and reflect the steadily increasing flow of Chinese outward investments, particularly to the U.S.

"Yesterday President Obama said in his State of [the] Union speech that right now is the best time to invest in America," Yuanqing said. "Well, we heard him and are doing exactly just that."