During World War II, Mahatma Gandhi led the Quit India Movement, a non-violent resistance against British rule in India. Gandhi hoped that, due to its military involvement in the war, Britain would capitulate and give India self-rule.
However, the Quit India Movement failed because its leaders did not present a clear plan of action and some supporters began to enact violence against buildings owned by the British government. Additionally, Great Britain acted swiftly to suppress the revolt, even going to so far as to imprison most of the India National Congress for most of the remainder of World War II. Britain also imprisoned as many as 100,000 Indian nationals for supporting the movement.
Nevertheless, the Quit India Movement may have contributed to the British government's eventual pull-out from India. They feared additional protests which would perhaps be even more violent. Thus Britain--weakened by World War II--decided that governing India was more trouble than it was worth.