Helen Zille, the ex-leader of South Africa's main opposition Democratic Alliance (DA), has publicly apologised for her tweets saying there were some positive aspects of colonialism.
She said that the tweets were "insensitive to South Africans".
Ms Zille will step down from all party leadership positions but remain the premier of Western Cape province.
Party leader Mmusi Maimane said the deal will help DA focus on the 2019 election.
He said the party chose to avoid a protracted legal battle and instead seek reconciliation.