A boy walks past portraits of former South African President Nelson Mandela, who died Thursday at age 95. (Rogan Ward/Reuters)

Tens of thousands gathered in Johannesburg, South Africa, on Tuesday to remember Nelson Mandela, that country’s former president who helped end apartheid (a-PAR-tied), rules that separated white and black people.

Mandela, who was 95, died Thursday after a long illness.

Nearly 100 heads of state, including President Obama, came to a rain-soaked soccer stadium to honor Mandela, who was jailed for 27 years when South Africa was ruled by an all-white government.

Obama urged people to apply the lessons of Mandela, who embraced his enemies when he was freed and promoted forgiveness in South Africa.

“We, too, must act on behalf of justice,” Obama said. “We, too, must act on behalf of peace.”

Tuesday marked the 20th anniversary of Mandela and F.W. de Klerk, South Africa’s last apartheid-era president, receiving the Nobel Peace Prize for their efforts to bring peace to their country. De Klerk, a political rival who became friends with Mandela, was also in the stadium on Tuesday.

Wire and staff reports