The rally in Pretoria was organised by the trade unionists and members of the South African Communist Party. The demonstrators oppose US policy on Cuba, Afghanistan, global warming and other issues.
Protesters carried signs that read: "No, You Can't Obama," a message inspired by the " Yes, We Can" campaign slogan adopted by the president during his first presidential campaign.
Obama and his family arrived in South Africa as part of their African tour.
Protesters also plan a rally on Saturday at the University of Johannesburg's Soweto campus, where Obama will address students and receive an honorary law degree.
(with agency inputs)