In South Africa Mohandas had faced the discrimination, which was commonly directed at the blacks and Indians. One day he was asked to remove his turban by the magistrate in court at Durban. Gandhi refused and stormed out of the courtroom. He was thrown off a train at Pietermaritzburg, after refusing to move from the first class to a third class coach while holding a valid first class ticket. Traveling further on by stagecoach, he was beaten by a driver for refusing to travel on the foot board to make room for a European passenger. He suffered other hardships on the journey as well, including being barred from many hotels. These were firsthand witnessing the racism, prejudice and injustice against Indians in South Africa which led him to question his people`s status and his own place in the society. These incidents have been acknowledged by several biographers as a turning point in his life, explaining his later social activism.
At the end of his contract, Gandhi prepared to return to India. Through a newspaper he came to know the fact that a bill to deny the right to vote to Indians was being considered by the Natal Legislative Assembly. This implored Gandhi to stay back and fight for the civilian right. He circulated several petitions in opposition to the bill to both the Natal Legislature and the British Government. Though unable to halt the bill`s passage, his campaign was successful in drawing attention to the grievances of Indians in South Africa. He was convinced by his supporters to remain in Durban to continue fighting against the injustices levied against Indians in South Africa. He founded the Natal Indian Congress in 1894, with himself as the Secretary.
In this organization, he molded the Indian community of South Africa into a homogeneous political force, publishing documents detailing Indian grievances and evidence of British discrimination in South Africa. Gandhi returned briefly to India in 1896 to bring his wife and children to live with him in South Africa. At the onset of the South African War, Gandhi argued that Indians must support the war effort in order to legitimize their claims to full citizenship, organizing a volunteer ambulance corps of 300 free Indians and 800 indentured labourers called the Indian Ambulance Corps, one of the few medical units to serve wounded black South Africans. The methodology of `Satyagraha`(devotion to the truth), or non-violent protest was adopted by Gandhi for the first time at a mass protest meeting held in Johannesburg on September 11th that year. This plan was adopted, leading to a seven-year struggle of thousands of Indians who were jailed (including Gandhi himself on many occasions), flogged, or even shot, for striking, refusing to register, burning their registration cards, or engaging in other forms of non-violent resistance.
Through Satyagraha Gandhi called on his fellow Indians to defy the new law and suffer the punishments for doing so, rather than resist through violent means. While the government was successful in repressing the Indian protesters, the public outcry stemming from the harsh methods employed by the South African government in the face of peaceful Indian protesters finally forced South African General Jan Christiaan Smuts to negotiate a compromise with Gandhi.