The Colombian pop star came to the Isu'lihle school, on the narrow, sinewy streets of the suburb of Soweto, to promote the 1Goal initiative, which urges world leaders to make education a political priority to improve the quality of life around the globe.
Shakira is among the artists performing Thursday at the World Cup Kickoff Concert. Juanes, Alicia Keys and the Black Eyed Peas are also slated to perform.
The schoolgirls, in red and black printed dresses, began to dance the Zulu "Indlamu" as soon as Shakira came through the school's doors.
The dancing continued with a performance from a local dance troupe, Youth Stand Together. They demonstrated the "Gumboot dance," with choreography inspired by South African miners who finish their workday with a mix of celebration and vigorous physical movements that help keep them in shape.
Later, sitting at a desk with a group of students, Shakira told stories of her elementary school days.
"The first two days, when my mom brought me to school, I cried," she said. "But later I told her, 'I'm OK mom. I like it."'
Next, it was off to the school's field, where she thanked the students for their performances by teaching them a few steps of "Waka Waka," the official song of the World Cup. For a moment, everyone danced together to the beat of the drum.
"I see that you're all musicians, dancers and very talented students," Shakira told the children, all residents of a Johannesburg suburb established as a black ghetto during apartheid, a shanty town of tiny homes made of brick, wood and sheet metal.
The activist and award-winning singer told the media that she sees the World Cup as "an enormous opportunity in which the world comes together to bring to light themes like education."
She said she feels she has been enriched by participating in the kickoff concert, having been chosen to sing the event's theme song, "Waka Waka (This is Africa) with the Ciudad del Cabo Freshlyground band.
"It's very emotional (to perform in the concert)," she said. "It's an important day for me."
She did not address the discontent expressed by some in South Africa who said a native singer should have been chosen to sing the World Cup theme.
Thursday's concert will feature international and local artists.