Indian Prime Minister Narendra Modi lauded the power of social media at a visit to Facebook Inc. Sunday for a town hall meeting. This was the latest stop on an official visit to the United States during which he has met leading businessmen from New York to California to discuss economics and diplomacy, as well as boost investments in India.

"I offer you my congratulations that you gave birth to the person who has connected the world," Modi told Facebook founder and CEO Mark Zuckerberg's parents at the company's headquarters in Menlo Park, California.

That connectedness is transforming individual lives as well as nations, from diplomacy to empowering young girls, Modi said, underscoring how social media companies such as Facebook in some ways have become more significant than heads of state at Capitol Hill.

"Once, governments of nations knew of each other, but with social media, the citizens of different nations know each other today," Modi said, speaking mostly in Hindi throughout the meeting. He recalled how a birthday message he sent to the Chinese premier on China's social networking site Weibo went viral there and how a good-wishes message sent in Hebrew to the Israeli prime minister during a Jewish festival resulted in a thank-you reply in Hindi.

Modi met the top bosses of Silicon Valley's best-known companies at a dinner Saturday, where he told them his government intended to "think a bit more like you" to achieve his goal of making India a $20 trillion economy in the years to come.

Indian Prime Minister Narendra Modi added a profile picture Sunday using a filter Facebook CEO Mark Zuckerberg introduced in support of the Digital India effort. Zuckerberg has added one of his own, using the filter that shows the tricolor of India's flag and a network of connected nodes.

Sunday's town hall meeting at Facebook comprised employees and people from around the world who had flown in to ask their questions in person. Some 40,000 questions and comments had been posted in response to Zuckerberg and Modi's announcement this month that the latter would visit the company, and about six were put to him, including two from Zuckerberg himself.

"When I took to social media, I hadn't really thought that one day I'd become a chief minister, or the prime minister," Modi said, who was chief minister of the federal state of Gujarat in western India before leading an election campaign that saw his nationalist Bharatiya Janata Party win a historic majority in India's parliamentary elections last year.

India's "vibrant democracy," which saw him -- once a humble tea seller -- advance to prime minister, was the first D that "like-minded nations" will find attractive in partnering with the country, he said.

To the two other Ds, demographic dividend -- 800 million people are below the age of 35 in India -- and demand -- India remains one of the fastest-growing major economies in the world -- "I will add the fourth D of deregulation," Modi said, adding his government was working with the World Bank to improve India's standing in the ease-of-doing-business rankings, which currently is at an abysmal 140.

What started as mere curiosity, joining social media, has now become a way to connect with India's 1.25 billion people on a daily basis, said Modi, who has recently launched his own iOS and Android mobile phone app, which provides daily updates on him.

"Right now, even as Modi is speaking, there is instant voting [on social media]. That's the power of social media," he said.

This real-time feedback can be something that governments can harness in shaping and changing policy, Modi said. India is building a fiber optic network intended to bring broadband Internet to 250,000 village centers and link some 600,000 villages to the Internet across the subcontinent within the next five years, he said.

Indian Prime Minister Narendra Modi (right) visited Elon Musk's Tesla factory Saturday. Modi, on an official visit to the U.S., traveled to the West Coast to boost support and investments for his Make In India and Digital India programs.

Responding to Zuckerberg's request to talk about his mother, a visibly emotional Modi recalled how while he was growing up, his mother had worked as house help washing dishes and had done manual labor to make ends meet, as his father wasn't alive. "It's not just my mother, but millions of mothers in India are similarly sacrificing their lives for the sake of their children," he said. "She is over 90 today but still does all her own work by herself."

That was an important influence on his decisions. "You can't imprison 50 percent of the population, the women, and still acheive" the transformation India is seeking for itself, Modi said.

Zuckerberg offered a surprise personal anecdote of his own, recalling how during the early days of Facebook, at a time of uncertainty about its future, a visit to a temple in India that Steve Jobs had been to, as well as seeing India up close in general, was pivotal to his resolve that he would continue to build Facebook.

Zuckerberg said: "Seeing how people connected, and having the opportunity to feel how much better the world could be if the world had a stronger ability to connect, reinforced for me the importance of what we were doing, and that is something that I've always rememebered."