KATHMANDU, Nepal — For months, the government of Nepal has struggled to contain public anger over a rise in sexual assaults in this small Himalayan nation — up 60 percent over the past five years, officials say.

Over the summer, a tipping point was reached after the rape and killing of a 13-year-old girl in western Nepal. Across the country, thousands of people demonstrated in the streets and accused the police of tampering with evidence to protect the attacker.

Under pressure, the government went back to a tactic it had tried years ago but then abandoned: It banned pornography. This time, it added harsh fines or prison sentences for internet service providers who refuse to comply.

“Pulling down such websites inside Nepal has become necessary,” read an official statement about the ban.