JOHANNESBURG—South Africa’s government has sold its 14% stake in mobile operator Vodacom Group Ltd., raising around $2 billion in cash to help refinance the country’s beleaguered state-owned power provider.

South Africa’s Finance Ministry said on Wednesday that the shares were sold to the Public Investment Corporation, which oversees South Africa’s $140 billion government pension fund.