Final answer:
Nelson Mandela, a civil rights leader, fought against injustice, went to prison for 27 years, and was later elected as the president of South Africa.
Step-by-step explanation:
The civil rights leader who fought against injustice, went to prison for 27 years, and was freed and elected president was Nelson Mandela. Mandela was a political leader of the ANC and the anti-apartheid movement in South Africa. He spent 27 years in prison for his resistance activities and was elected as the first president in the post-apartheid era.