The search giant is selling the struggling smartphone maker for a fraction of the $12.5 billion it paid in 2012 (Spencer Platt/Getty Images)

Google on Wednesday agreed to sell its Motorola Mobility handset business to China’s Lenovo for $2.91 billion. The Internet giant said it has given up on the competitive market of manufacturing smartphones and is focusing on developing software for devices of the future.

The search giant is selling the struggling smartphone maker for a fraction of the $12.5 billion it paid in 2012. The deal is a concession of sorts for Chief Executive Larry Page, who orchestrated the company’s biggest acquisition soon after reassuming his leadership role in 2011.

Since the acquisition, Motorola’s Moto G and Moto X smartphones have failed to capture the same enthusiasm from consumers that Apple and Samsung have enjoyed with their iPhone and Galaxy devices.

But Google said the sales of Motorola Mobility falls in line with its strategy to focus on developing its Android software platform for a new generation of devices such as wearable computers and Internet-connected gadgets for the home.

Analayst say Google is keeping the most valuable asset it bought from Motorola: the vast majority of patents used to develop Android products.

“The smartphone market is super competitive, and to thrive it helps to be all-in when it comes to making mobile devices,” Page said in a blog post. “It’s why we believe that Motorola will be better served by Lenovo — which has a rapidly growing smartphone business and is the largest (and fastest-growing) PC manufacturer in the world.”

The deal, analysts say, illustrates a broader shift in focus by Silicon Valley giants that are grasping for new gadget inspiration as sales of smartphones begin to soften. Apple’s stock was slammed this week after it reported sales of its blockbuster iPhone were weaker than industry analysts had expected.

Lenovo has been on a buying spree of computer and smartphone companies. Last week, Lenovo purchased IBM’s low-end server business. In 2005, it bought IBM’s iconic Think Pad line of laptop computers.

The IBM and Google deals will separately undergo federal regulatory review, including scrutiny by the Committee on Foreign Investment in the United States to vet any national security concerns.

Lenovo’s stock and cash deal for Motorola would give the Chinese handset maker an entry into smartphone markets in developed nations, which have been dominated by Apple and Samsung.

“The acquisition of such an iconic brand, innovative product portfolio and incredibly talented global team will immediately make Lenovo a strong global competitor in smartphones,” Yang Yuanqing, chairman and CEO of Lenovo, said in a statement. “We will immediately have the opportunity to become a strong global player in the fast-growing mobile space.”

Sales of Motorola Mobility’s Moto X and Moto G smartphones have been lackluster but still rank third in Android smartphone sales in the U.S. and Latin America.

Google said that with the sale, it will focus on building new Android products in the emerging space of wearable technology and connected devices for the home.

“As a side note, this does not signal a larger shift for our other hardware efforts. The dynamics and maturity of the wearable and home markets, for example, are very different from that of the mobile industry,” Page said. “We’re excited by the opportunities to build amazing new products for users within these emerging ecosystems.”

Follow The Post’s new tech blog, The Switch, where technology and policy connect.