Microsoft, which once called Linux a "cancer," is now embracing the open-source operating system and using it to secure internet-connected devices.

At an event on Monday, Microsoft introduced Azure Sphere, a package of products including a new design for chips that will be packed into small gadgets deployed around the world, and said it's using Linux to secure these chips. Many products containing small computers are currently not connected to the web, representing a big opportunity for technology companies.

The announcement marks Microsoft's latest embrace of a former rival technology, as the company relies less on its legacy Windows franchise and more on providing powerful cloud-connected services.

"Of course we are a Windows company, but what we've recognized is the best solution for a computer of this size in a toy is not a full version of Windows," Brad Smith, Microsoft's president and chief legal officer, said at the event in San Francisco. "It is what we are creating here."

With the introduction of the Azure Sphere OS, Microsoft will be distributing a custom Linux kernel for the first time, Smith said. The technologies will be free of royalties and licenses.

Chipmaker Mediatek said in a statement that it's sampling compatible Azure Sphere-certified chips with some customers. The chips will be more widely available in the third quarter, and more chip partners will be coming over time.