JOHANNESBURG—Winnie Madikizela-Mandela, who like her former spouse, Nelson, endured prison and personal sacrifices for black freedom, but became a divisive figure in a democratic South Africa, died Monday. She was 81 years old.

The second wife of Mr. Mandela, South Africa’s first black president, was the public face of the fight against white-minority rule during her husband’s 27-year political imprisonment. As the attention of much of the antiapartheid movement focused on Mr. Mandela’s plight in prison, Ms. Madikizela-Mandela was herself subjected to police harassment, abuse and long periods in jail.

The Mandela family confirmed that Ms. Madikizela-Mandela died in the early hours of Monday in a Johannesburg hospital. Despite health issues in recent years, she remained active in South African politics, and the African National Congress, until her final days.

“She never doubted that the struggle for freedom and democracy would triumph and succeed,” South African President Cyril Ramaphosa said in a televised address, visibly shaken. “She remained throughout her life a tireless advocate for the dispossessed and the marginalized. She was the voice for the voiceless.”

Ms. Madikizela-Mandela won global recognition for her struggle on behalf of the antiapartheid movement, as well as unwanted scrutiny over how she resisted white minority rule.