“WE SAY no to the killing of civilians!” Jacob Zuma, South Africa's president, thundered on March 21st. “No to the foreign occupation of Libya or any other sovereign state!” The crowd, mainly supporters of the ruling African National Congress (ANC), roared back its approval. Theirs, after all, was the country of human rights, a beacon to the world, as their first black president, Nelson Mandela, had proclaimed. Just four days earlier, however, South Africa had voted for the UN Security Council resolution calling for “all necessary measures” to be taken to protect Libyan civilians under threat, including the imposition of a no-fly zone. Did Mr Zuma believe this could be done without recourse to force? He is not that naive.

These days South Africa's foreign policy swings back and forth. Under Thabo Mbeki, Mr Zuma's globe-trotting predecessor, it seemed to have an overarching aim, at least on paper: the promotion of an “African renaissance”, even if that meant ignoring the human-rights violations of some of South Africa's allies. But now, as Mr Zuma flits ever more energetically around the world, charming everyone as he always does, it is hard to find a pattern to his policies. “None of it makes any real sense,” says Tom Wheeler, a former South African ambassador and now a research fellow with the South African Institute of International Affairs: “There's no substance, no coherence.”

In fact, South Africa often appears to be pursuing two contradictory sets of values. At one moment, Mr Zuma is upholding the principles of national sovereignty and non-interference dear to despots around the world. At the next, he insists that his “primary objective” is to contribute to the ideals of democracy, human rights and justice. The result is a mishmash of unpredictable responses to apparently similar situations in different countries.

In the face of the recent uprising in Egypt, for example, Mr Zuma joined the international chorus demanding the resignation of Hosni Mubarak, the president. But in the face of dreadful factional violence and impending civil war in Côte d'Ivoire, South Africa sat on the fence for months, refusing to accept Alassane Ouattara's internationally recognised victory in November's presidential elections until earlier this month, when it endorsed the call of the peace and security committee of the African Union (AU) for the defeated incumbent, Laurent Gbagbo, to step down. In Swaziland, Africa's last absolute monarchy, right on South Africa's doorstep, Mr Zuma remains obdurately silent over the violation of civil rights and the suppression of pro-democracy protests, yet recently recalled his ambassador to Israel after Israeli commandos stopped a flotilla of pro-Palestinian campaigners from reaching Gaza, killing nine Turks on board.

The same contradiction is seen in South Africa's handling of Myanmar and Zimbabwe. In Myanmar Mr Zuma did not hesitate to condemn November's rigged elections and call for the release of the opposition leader, Aung San Suu Kyi. Yet he refrains from peeping a word of public criticism of Zimbabwe's ageing dictator, Robert Mugabe, despite a string of rigged and robbed elections, killings, torture and other state-sponsored violence. Last October South Africa appeared to change its studied neutrality on Iran's nuclear plans, voting for UN sanctions on Iran, only to claim that it had actually intended to vote against the measure. And when the jailed Chinese dissident, Liu Xiaobo, was awarded the Nobel peace prize in December, South Africa was one of the few countries to refuse to congratulate him.

Next month South Africa is due to be formally inducted into membership of the BRICs, a club of regional power brokers embracing Brazil, Russia, India and China, which have recently shown a desire to use their combined size and economic might—together they account for 40% of the world's population—to counter the West's global dominion. They also want to reform such institutions as the UN Security Council and the World Bank.

Will South Africa—its GDP, population and land mass all dwarfed by the BRIC giants—find itself obliged to align its foreign policy more with its new peers, notably Russia and China? Perhaps not, judging by its recent vote in favour of the Libyan no-fly zone. The other BRICS (with a capital S), as the enlarged group will be known, all abstained. Perhaps, after Mr Zuma's latest exclamation, South Africa will again claim it had really meant to vote against the resolution.