Sometimes the demonstrations turned violent and in 1964 Mandela was sentenced to life in prison on Robben Island.
While Mandela was in prison photos of him were banned and it was even illegal to quote him in public.
But people from all over the world campaigned for his release. Songs were written and big concerts were held in protest.
Finally in 1990 the South African President FW de Klerk - a white man - allowed him to go free.
Mandela had spent 27 years in jail and was greeted as a hero on his release.