Indian Prime Minister Narendra Modi, waves from a train carriage at Pentrich Railway station in Pietermaritzburg, South Africa, Saturday July 9, 2016. Narendra Modi is taking the same historic train trip that Mahatma Gandhi took in 1893 when he was thrown off the train because of his race. Modi is on a four nation trip to Africa.
Indian Prime Minister Narendra Modi, waves from a train carriage at Pentrich Railway station in Pietermaritzburg, South Africa, Saturday July 9, 2016. Narendra Modi is taking the same historic train trip that Mahatma Gandhi took in 1893 when he was thrown off the train because of his race. Modi is on a four nation trip to Africa.

SAN FRANCISCO (Diya TV) — Indian Prime Minister Narendra Modi on Saturday marked a historic South African train journey by Indian independence leader Mohandas K. Gandhi that ended up shaping the fate of both countries.

Modi’s ride came in the prime minister’s efforts to commemorate the journey, during which a young Gandhi in 1893 was ejected from a South African train when he refused an order to move from a first-class carriage because of his race. The encounter during his train ride influenced Gandhi’s decision to resist racial segregation and other social injustices through the usage of nonviolent protest, first while living in South Africa then in his native India.

Sitting in a wood-paneled car with local officials Saturday, Modi’s ride was protected by much heavier security. However, the prime minister also took some time in South Africa to mingle with some of nation’s residents of Indian origin, of which there are more than one million of.

“We didn’t expect him to go and mix with all the people, but he did,” said Ela Gandhi, granddaughter of Gandhi and a former member of South Africa’s parliament. “That’s good. That is what we need.”

Modi would later tell reporters that he’d had the great fortune to pay his respects at places “that are memorable for being part of Mahatma Gandhi’s life and in India’s independence journey.”

India’s government says it was the first country to sever trade relations with South Africa over its former harsh system of racial segregation, which finally ended in the 1990s after being in place for multiple decades.

Modi and South African President Jacob Zuma met on Friday, paying tribute to what Zuma called “two liberation icons,” Gandhi and Nelson Mandela, South Africa’s first black president, who was elected in 1994.

After his time in South Africa, Modi continued his four-nation African visit with a stop in Tanzania. His fourth and final stop on the tour, meant to raise India’s profile in Africa, where China’s presence has been strong, will conclude when the prime minister visits Kenya. He began his trip last week in Mozambique.