Facebook (FB) is spending billions of dollars for a stake in India's largest mobile operator, and teaming up with the country's richest man to tap into an internet boom.

The deal, announced, will see the US company invest $5.7 billion for a 9.99% stake in Jio Platforms, the digital technology arm of Indian billionaire Mukesh Ambani's sprawling conglomerate Reliance Industries.

Jio Platforms has several services under its umbrella, including Reliance Jio, the mobile network that has taken India by storm since launching less than four years ago, racking up 388 million users, putting his brother and rival out of business and forcing other local operators to merge. Apps where users can stream movies, shop online and read news also fall under Jio Platforms.

The tie-up includes a commercial partnership with WhatsApp that potentially paves the way for Facebook to make money from the messaging service's 400 million users in India.

The partnership comes at a key time for tech in India. The market is growing, but it's getting tougher for global firms to profit because of shifting regulations, making it all the more important for companies like Facebook to forge key alliances if they want to cash in. It is also a huge investment at a time when the global economy is teetering on the edge.

Facebook founder Mark Zuckerberg noted that India is home to the largest Facebook and WhatsApp communities.

India also has more than 60 million small businesses and many of them "need digital tools they can rely on to find and communicate with customers and grow their businesses," Zuckerberg wrote in a Facebook post.

In a video message, Ambani laid out a wide swath of opportunities ahead, saying in the "very near future" the tie-up between JioMart, the company's e-commerce platform, and WhatsApp will empower nearly 30 million small Indian shops "to digitally transact with every customer in their neighborhood."

"This means all of you can order and get faster delivery of day-to-day items from nearby local shops," he said.

Ambani called it a "winning recipe" that will eventually "be extended to serve other key stakeholders of Indian society," such as agricultural workers, small and medium enterprises, students and teachers, and healthcare providers.

India is in the midst of an internet boom. It is the world's second-largest smartphone market and it boasts hundreds of millions of users eager to buy stuff online, stream music and watch online videos.

And there is plenty of room to grow: Close to 600 million people in the country have yet to gain internet access.

That is why the likes of Alibaba (BABA), Amazon (AMZN), Google (GOOGL), Tencent (TCEHY), SoftBank (SFTBY SOFTBANK) and countless other technology giants have pumped billions of dollars into India's internet scene.

The investment in Jio is one of the biggest investments Facebook can make, according to Bernstein, and could help the Silicon Valley firm experiment with something akin to WeChat, the popular messaging app in China that is used for everything from booking doctor's appointments to making digital payments.

The billionaire launched Reliance Jio in September 2016 with an irresistible inaugural offer: New customers received six months of free 4G high-speed internet. That triggered a price war, forcing other mobile providers to dramatically slash rates

According to a company spokesperson, the name Jio was chosen because it is the mirror image of "oiL" — refining crude is the main business of Reliance Industries.

But Jio also means "to live" in Hindi, and Ambani has certainly pushed hundreds of millions of Indians to live increasingly digital lives. And with new regulations in the works that could make it much harder for global tech firms trying to profit from India's massive market, Ambani has become something of a gatekeeper of the country's internet.

The Facebook investment values Jio Platforms at nearly $66 billion, according to Reliance.

Facebook is spending $5.7 billion to capitalize on India's internet boom.