Protests against a brutal gang rape galvanized thousands of young Facebook- and Twitter-savvy Indians last week, and they once again exposed the Indian government’s beleaguered and ­often-blundering efforts to join the social media bandwagon.

The government appeared to be caught off guard by the outrage that started online and spilled into the streets over the Dec. 16 rape of a New Delhi woman, who died two weeks later. Its slow but eventual response was a series of bland, scripted statements by ruling politicians, some embarrassing faux pas and a heavy police crackdown.

Every misstep trending on Twitter, viewed on YouTube and liked on Facebook only exacerbated the image of a lumbering government that just could not match up.

“The government is completely disconnected with the reality of the 21st-century urban India,” said Reema Ganguly, 44, who posted Facebook messages, photographs and videos from a protest in New Delhi. “They can’t keep talking down to us, but they must engage with us.

“Facebook is not just about making friends,” Ganguly added. “After the gang-rape incident, we aired our grievances, shared stories of our experiences of facing sexual violence daily in this city and signed petitions. Word spreads like wildfire on social media. Does the government even understand this anger?”

But now, as government officials battle urban unpopularity and gear up for possible early national elections later this year, they are indicating a willingness to take steps — albeit baby steps — toward befriending social media.

“The government is still stuck in an outdated platform from the 1960s and needs to reorient its thinking,” Manish Tiwari, India’s recently appointed information and broadcasting minister, said in an interview. “Everybody is on a learning curve on this. We ignore social media at our own peril.”

In the past year, India’s government has approached social media with deep suspicion. It has sought to require Web sites and search engines to screen content that it considers offensive, taken down satirical Facebook cartoons and blocked sites it said were inciting hate.

Now the government is formulating a new policy and will appoint a core team to train officials about social media, which, Tiwari said, “needs to be embraced, not shunned, feared, controlled or banned.”

The government has faced massive criticism online in the past two years. Like last week’s demonstrations, anti-corruption protests last year were mobilized on Facebook and attracted an unprecedented number of urban middle-class Indians who were fed up with rising graft.

India’s politicians have traditionally paid greater heed to rural populations because they yield more votes. But the protests have forced them to reckon with the more demanding and unforgiving urban middle class fostered by the nation’s economic growth.

“The government is extremely nervous about the rise of anger and dissent in the social media but does not know how to respond,” said Dipankar Gupta, a social anthropologist who wrote a book on the country’s middle class. “The entire political class has barricaded itself from the people. That inability and unwillingness to communicate came to a head in the way it responded to the demonstrations against rape last week.”

In a column titled “Clueless in Blunderland” in the India Today newsmagazine last week, Gupta wrote: “While the young demonstrators were screaming their lungs out, old politicians were still wondering whether they should clear their throats.”

But there are signs of a grudging realization among politicians that many younger Indian voters form opinions by consuming information online, not by listening to traditional political speeches.

The government held its first Twitter news conferences last year. Reviews were mixed, in part because Sam Pitroda, the prime minister’s adviser who did the tweeting, did not respond to many hostile questions and comments. Tiwari is now planning to hold a news conference using Google+ Hangouts, a form of video chat.

It remains uncertain, however, whether the nation’s entrenched, top-down political and government structures are ready to make a culture shift fit for an era of user-generated content.

This week, the government’s most active tweeting minister, Shashi Tharoor, the human resource development junior minister, gained widespread praise for tweeting that a proposed anti-rape law should be named after the 23-year-old gang-rape victim.

His party swiftly faulted him for jumping the political protocol.

“It is his personal opinion. I suggest that since he is a part of the government, he should have given the suggestion to the government rather than making any such statement in public,” Rashid Alvi, a spokesman for the ruling Congress party, told reporters in New Delhi on Wednesday.