AHMEDABAD, India — At least six people have died in the worst violence to hit Narendra Modi’s home state in more than a decade, police said Wednesday, as the Indian prime minister appealed for calm. Authorities in western Gujarat state said the army had been deployed to try to restore peace after a mass rally turned violent, with protesters torching cars, buses and police stations. The violence appears to have been triggered by the detention late Tuesday of the 22-year-old leader of a mass movement by the Patidar or Patel caste to demand preferential treatment for jobs and university places. Director general of police P.P. Pande told AFP three people had been killed in the main city of Ahmedabad, where an estimated half a million people gathered for a rally on Tuesday. The violence later spread to other parts of the state and another two people were killed when police opened fire on rioters early Wednesday in Banaskantha district. A sixth protester died in Mehsana district later Wednesday, also in police firing, the district superintendent J.R. Mothalia told AFP by phone. “I appeal to all brothers and sisters of Gujarat that they should not resort to violence,” Modi said in a statement. “Violence has never done good for anyone. All issues can be resolved peacefully through talks,” said Modi, who served as the state’s chief minister for more than a decade, in a television address delivered in his native Gujarati. Media reports said it was the first time the army had to be deployed in Gujarat since religious violence in 2002 that left more than 1,000 people dead, most of them Muslims. The streets of Ahmedabad were deserted on Wednesday with schools, shops and businesses closed. But some protests continued in Surat, the center of India’s lucrative diamond trade, where local media said police used tear gas to disperse demonstrators. Political leaders appeared to have been taken by surprise by the scale of the protest movement, which only began earlier this year but has rapidly gathered pace in recent weeks. The Patidars or Patels are one of the state’s most affluent communities, but they say they are struggling to compete with less privileged castes for jobs. India sets aside a proportion of government jobs and university places for Dalits, known as “untouchables,” and for so-called “other backward castes” under measures intended to bring victims of the worst discrimination into the mainstream.