Nationalism grew in India in the 1800s as the British established political and economic control over the subcontinent. This led Indians to resent being ruled by a foreign power and treated as second-class citizens. In the early 20th century, Mohandas Gandhi emerged as a leader of the Indian independence movement, advocating for nonviolent civil disobedience. Through nonviolent protests like boycotts and hunger strikes, Gandhi helped force the British to grant India independence in 1947, though the country was still partitioned along religious lines.