The students’ parents encouraged their daughters to stand their ground, according to their lawyer, Mohammed Tahir. They continued to wear the hijab after the school, Government Women’s PU, moved in January to ban it on campus, saying it violated the school’s dress code. The school issued the prohibition after meeting with a local lawmaker from Mr. Modi’s Bharatiya Janata Party, or B.J.P.
“Then the issue started blowing up,” Mr. Tahir said. “Whenever students would go in hijab, they wouldn’t be allowed inside the compound, too, let alone the classroom.”
In recent weeks, the students have been met at the campus gates by scores of boys and men wearing saffron — the color most associated with Hinduism, often worn by supporters of Hindu nationalism — and shouting slogans such as “Hail Lord Ram,” referring to the Hindu god.
The unrest also spread to at least a dozen other campuses in the state. On Tuesday, officials ordered schools to close for three days as the police struggled to respond to intensified demonstrations.
At one campus, a boy climbed a flagpole, hoisting a saffron flag as others in saffron scarves cheered below, according to video from local TV news reports. At an engineering school, video showed, a girl arriving in a hijab and robe was met by a large group of boys shouting Hindu slogans. She shook her fist at them.
As the formerly fringe view that India should become a more explicitly Hindu state has found a mainstream advocate in Mr. Modi, Amnesty International and other human rights watchdogs have warned that religious animosity could spiral out of control, perhaps even emboldening Hindu extremists to commit genocide against India’s Muslims, who make up about 15 percent of the country, and 13 percent in Karnataka.
Secularism is a cornerstone of India’s Constitution, but the line between the state and religion has blurred in recent years, with a saffron-robed Hindu monk at the helm of the government in the state of Uttar Pradesh, and the prime minister seen on television performing Hindu rituals and prayers, observers said.